diff options
-rw-r--r-- | libpthread/linuxthreads/errno.c | 22 | ||||
-rw-r--r-- | libpthread/linuxthreads/pthread.c | 4 |
2 files changed, 21 insertions, 5 deletions
diff --git a/libpthread/linuxthreads/errno.c b/libpthread/linuxthreads/errno.c index ad43be47a..46e2fbb35 100644 --- a/libpthread/linuxthreads/errno.c +++ b/libpthread/linuxthreads/errno.c @@ -20,15 +20,29 @@ #include <netdb.h> #include "pthread.h" #include "internals.h" +#include <stdio.h> +extern int _errno; +extern int _h_errno; int * __errno_location() { - pthread_descr self = thread_self(); - return THREAD_GETMEM (self, p_errnop); + /* check, if the library is initilize */ + if (__pthread_initial_thread_bos != NULL) + { + pthread_descr self = thread_self(); + return THREAD_GETMEM (self, p_errnop); + } + return &_errno; } int * __h_errno_location() { - pthread_descr self = thread_self(); - return THREAD_GETMEM (self, p_h_errnop); + /* check, if the library is initilize */ + if (__pthread_initial_thread_bos != NULL) + { + pthread_descr self = thread_self(); + + return THREAD_GETMEM (self, p_h_errnop); + } + return &_h_errno; } diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c index 90c770879..548f83a5f 100644 --- a/libpthread/linuxthreads/pthread.c +++ b/libpthread/linuxthreads/pthread.c @@ -349,8 +349,10 @@ int __pthread_initialize_manager(void) NOMMU_INITIAL_THREAD_BOUNDS(__pthread_manager_thread_tos,__pthread_manager_thread_bos); PDEBUG("manager stack: size=%d, bos=%p, tos=%p\n", THREAD_MANAGER_STACK_SIZE, __pthread_manager_thread_bos, __pthread_manager_thread_tos); +#if 0 PDEBUG("initial stack: estimate bos=%p, tos=%p\n", - __pthread_initial_thread_bos, __pthread_initial_thread_tos); + __pthread_initial_thread_bos, __pthread_initial_thread_tos); +#endif /* Setup pipe to communicate with thread manager */ if (pipe(manager_pipe) == -1) { |