lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <features.h> |
| 2 | |
| 3 | #ifdef __UCLIBC_HAS_TLS__ |
| 4 | __thread int errno; |
| 5 | __thread int h_errno; |
| 6 | |
| 7 | extern __thread int __libc_errno __attribute__ ((alias ("errno"))) attribute_hidden; |
| 8 | extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno"))) attribute_hidden; |
| 9 | #define h_errno __libc_h_errno |
| 10 | |
| 11 | #else |
| 12 | #include "internal_errno.h" |
| 13 | int errno = 0; |
| 14 | int h_errno = 0; |
| 15 | #ifdef __UCLIBC_HAS_THREADS__ |
| 16 | libc_hidden_def(errno) |
| 17 | weak_alias(errno, _errno) |
| 18 | libc_hidden_def(h_errno) |
| 19 | weak_alias(h_errno, _h_errno) |
| 20 | #endif |
| 21 | #endif |