kernel: support using thread local storage for errno
This enables storing errno in the thread local storage area. With this enabled, a syscall to access errno can be avoided when userspace is also enabled. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2c8625ea7e
commit
62cf1960ad
5 changed files with 35 additions and 3 deletions
|
@ -23,6 +23,11 @@
|
|||
const int _k_neg_eagain = -EAGAIN;
|
||||
|
||||
#ifdef CONFIG_ERRNO
|
||||
|
||||
#ifdef CONFIG_ERRNO_IN_TLS
|
||||
__thread int z_errno_var;
|
||||
#else
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
int *z_impl_z_errno(void)
|
||||
{
|
||||
|
@ -44,4 +49,7 @@ int *z_impl_z_errno(void)
|
|||
return &_current->errno_var;
|
||||
}
|
||||
#endif /* CONFIG_USERSPACE */
|
||||
|
||||
#endif /* CONFIG_ERRNO_IN_TLS */
|
||||
|
||||
#endif /* CONFIG_ERRNO */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue