LibC: Make errno macro directly access uthread
This allows inlining errno usages This breaks libc ABI and requires toolchain rebuild
This commit is contained in:
@@ -7,7 +7,6 @@ set(LIBC_SOURCES
|
||||
dlfcn.cpp
|
||||
endian.cpp
|
||||
environ.cpp
|
||||
errno.cpp
|
||||
fcntl.cpp
|
||||
fenv.cpp
|
||||
fnmatch.cpp
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
int* __errno_location()
|
||||
{
|
||||
return &_get_uthread()->errno_;
|
||||
}
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <bits/types/uthread.h>
|
||||
|
||||
#define errno (_get_uthread()->errno_)
|
||||
|
||||
#define E2BIG 1
|
||||
#define EACCES 2
|
||||
#define EADDRINUSE 3
|
||||
@@ -94,10 +98,6 @@ __BEGIN_DECLS
|
||||
#define ERESTART 0xFE /* internal errno for SA_RESTART */
|
||||
#define EUNKNOWN 0xFF
|
||||
|
||||
#define errno (*__errno_location())
|
||||
|
||||
int* __errno_location(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user