diff options
author | Ayrton Munoz <ayrton@google.com> | 2022-07-19 01:46:05 -0400 |
---|---|---|
committer | Ayrton Munoz <ayrton@google.com> | 2022-09-07 14:15:40 -0400 |
commit | cc15b8c55f329b1a37fc6c51cb4fc88bd111d458 (patch) | |
tree | 69ae1fdf87e77087fdc0a290597307f243dcae3e /lib | |
parent | 4a22d09f517984f12a89eda1a822b87e85c2b45c (diff) | |
download | common-cc15b8c55f329b1a37fc6c51cb4fc88bd111d458.tar.gz |
lib/libc: Alias __errno_location to __geterrno
Musl defines the errno macro as (*__errno_location()) so
this commit aliases __errno_location to __geterrno. Musl
also internally defines the errno macro as
(*___errno_location) in src/include/errno.h so this aliases
both to the LK implementation __geterrno.
Bug: 230134581
Change-Id: I30527f0fc9016f3e608a15f41f636fb05f04f373
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/errno.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/errno.c b/lib/libc/errno.c index d9b76cc5..7978a0e7 100644 --- a/lib/libc/errno.c +++ b/lib/libc/errno.c @@ -22,6 +22,7 @@ */ #include <errno.h> +#include <lk/compiler.h> /* completely un-threadsafe implementation of errno */ /* TODO: pull from kernel TLS or some other thread local storage */ @@ -32,3 +33,5 @@ int *__geterrno(void) return &_errno; } +extern int *__errno_location(void) __WEAK_ALIAS("__geterrno"); +extern int *___errno_location(void) __WEAK_ALIAS("__geterrno"); |