diff options
Diffstat (limited to 'lib/libkse/sys/thr_error.c')
-rw-r--r-- | lib/libkse/sys/thr_error.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libkse/sys/thr_error.c b/lib/libkse/sys/thr_error.c index a4a8507..6f19f93 100644 --- a/lib/libkse/sys/thr_error.c +++ b/lib/libkse/sys/thr_error.c @@ -36,14 +36,18 @@ #include <pthread.h> #include "libc_private.h" #include "thr_private.h" + extern int errno; -int * __error() +int * +__error(void) { struct pthread *curthread; if (__isthreaded == 0) return (&errno); + else if (_kse_in_critical()) + return &(_get_curkse()->k_error); else { curthread = _get_curthread(); if ((curthread == NULL) || (curthread == _thr_initial)) |