From 8cc6f6ddd6e0ff882ec5bd10700058df345cea19 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 10 May 2017 23:57:45 +0300 Subject: [PATCH] kernel: errno: Use per-thread accessor function compatible with Newlib Newlib names this function __errno(), so if we want Zephyr to work with Newlib seamlessly, it's better to just follow Newlib's naming convention for Zephyr's own minimal libc. Signed-off-by: Paul Sokolovsky --- kernel/errno.c | 2 +- lib/libc/minimal/include/errno.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/errno.c b/kernel/errno.c index 249a31ff74c..00fba34a980 100644 --- a/kernel/errno.c +++ b/kernel/errno.c @@ -22,7 +22,7 @@ const int _k_neg_eagain = -EAGAIN; #ifdef CONFIG_ERRNO -int *_get_errno(void) +int *__errno(void) { return &_current->errno_var; } diff --git a/lib/libc/minimal/include/errno.h b/lib/libc/minimal/include/errno.h index 4c15b490fcc..6acf9bdd3d4 100644 --- a/lib/libc/minimal/include/errno.h +++ b/lib/libc/minimal/include/errno.h @@ -22,8 +22,8 @@ extern "C" { #endif -extern int *_get_errno(void); -#define errno (*_get_errno()) +extern int *__errno(void); +#define errno (*__errno()) /* * POSIX Error codes