blob: 11d19eeef16f8207df7ce8066714be6471b6b481 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <features.h>
2
3#ifdef __UCLIBC_HAS_TLS__
4__thread int errno;
5__thread int h_errno;
6
7extern __thread int __libc_errno __attribute__ ((alias ("errno"))) attribute_hidden;
8extern __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"
13int errno = 0;
14int h_errno = 0;
15#ifdef __UCLIBC_HAS_THREADS__
16libc_hidden_def(errno)
17weak_alias(errno, _errno)
18libc_hidden_def(h_errno)
19weak_alias(h_errno, _h_errno)
20#endif
21#endif