1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include <netdb.h>
- #ifdef __UCLIBC_HAS_TLS__
- #include <tls.h>
- #endif
- #include <linuxthreads/internals.h>
- #include <sysdep-cancel.h>
- #ifndef __UCLIBC_HAS_TLS__
- # undef h_errno
- extern int h_errno;
- #endif
- int *
- weak_const_function
- __h_errno_location (void)
- {
- #ifndef __UCLIBC_HAS_TLS__
- if (! SINGLE_THREAD_P)
- {
- pthread_descr self = thread_self();
- return LIBC_THREAD_GETMEM (self, p_h_errnop);
- }
- #endif
- return &h_errno;
- }
- libc_hidden_def (__h_errno_location)
|