From 64ad838fde7ab4333fadc804a0339a074d041767 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 31 Jul 2016 02:30:05 +0300 Subject: [PATCH] esp8266/esp_mphal: Implement libc's errno. Using __errno() function, and redirect it to use mp_stream_errno from stream module. This is pre-requisite for integrating with 3rd-party libs, like BerkeleyDB. --- esp8266/esp_mphal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index 3cc4610825..a2710af2e6 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -259,3 +259,8 @@ int ets_esf_free_bufs(int idx) { } return cnt; } + +extern int mp_stream_errno; +int *__errno() { + return &mp_stream_errno; +}