Completes the Implementation of the TLS-based errno

- Remove per-thread errno from the TCB structure (pterrno)
- Remove get_errno() and set_errno() as functions.  The macros are still available as stubs and will be needed in the future if we need to access the errno from a different address environment (KERNEL mode).
- Add errno value to the tls_info_s structure definitions
- Move sched/errno to libs/libc/errno.  Replace old TCB access to the errno with TLS access to the errno.
This commit is contained in:
Gregory Nutt
2020-05-07 14:15:09 -06:00
committed by Abdelatif Guettouche
parent a6da3c2cb6
commit 3dca5eba15
51 changed files with 475 additions and 1143 deletions
-2
View File
@@ -28,7 +28,6 @@
"fstatfs","sys/statfs.h","","int","int","FAR struct statfs *"
"fsync","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int"
"ftruncate","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t"
"get_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","int"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char *","FAR const char *"
"getgid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","gid_t"
"getitimer","sys/time.h","!defined(CONFIG_DISABLE_POSIX_TIMERS)","int","int","FAR struct itimerval *"
@@ -143,7 +142,6 @@
"send","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR const void *","size_t","int"
"sendfile","sys/sendfile.h","defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t *","size_t"
"sendto","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR const void *","size_t","int","FAR const struct sockaddr *","socklen_t"
"set_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","void","int"
"setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *","FAR const char *","int"
"setgid","unistd.h","defined(CONFIG_SCHED_USER_IDENTITY)","int","gid_t"
"sethostname","unistd.h","","int","FAR const char *","size_t"
1 _exit unistd.h void int
28 fstatfs sys/statfs.h int int
29 fsync unistd.h !defined(CONFIG_DISABLE_MOUNTPOINT) int int
30 ftruncate unistd.h !defined(CONFIG_DISABLE_MOUNTPOINT) int int
get_errno errno.h !defined(__DIRECT_ERRNO_ACCESS) int
31 getenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char * FAR const char *
32 getgid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) gid_t
33 getitimer sys/time.h !defined(CONFIG_DISABLE_POSIX_TIMERS) int int
142 send sys/socket.h defined(CONFIG_NET) ssize_t int
143 sendfile sys/sendfile.h defined(CONFIG_NET_SENDFILE) ssize_t int
144 sendto sys/socket.h defined(CONFIG_NET) ssize_t int
set_errno errno.h !defined(__DIRECT_ERRNO_ACCESS) void int
145 setenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) int FAR const char *
146 setgid unistd.h defined(CONFIG_SCHED_USER_IDENTITY) int gid_t
147 sethostname unistd.h int FAR const char *
-11
View File
@@ -95,17 +95,6 @@
* Pre-processor Definitions
****************************************************************************/
/* Errno access is awkward. We need to generate get_errno() and set_errno()
* interfaces to support the system calls, even though we don't use them
* ourself.
*
* The "normal" pre-processor definitions for these functions is in errno.h
* but we need the internal function prototypes in nuttx/errno.h.
*/
#undef get_errno
#undef set_errno
/****************************************************************************
* Public Data
****************************************************************************/