summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/sys/thr_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/sys/thr_error.c')
-rw-r--r--lib/libpthread/sys/thr_error.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libpthread/sys/thr_error.c b/lib/libpthread/sys/thr_error.c
index a4a8507..6f19f93 100644
--- a/lib/libpthread/sys/thr_error.c
+++ b/lib/libpthread/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))
OpenPOWER on IntegriCloud