errno.c 479 B

12345678910111213141516171819202122
  1. #include <features.h>
  2. #ifdef __UCLIBC_HAS_TLS__
  3. __thread int errno;
  4. __thread int h_errno;
  5. extern __thread int __libc_errno __attribute__ ((alias ("errno")));
  6. extern __thread int __libc_h_errno __attribute__ ((alias ("h_errno")));
  7. #define h_errno __libc_h_errno
  8. #else
  9. #include "internal_errno.h"
  10. int errno = 0;
  11. int h_errno = 0;
  12. #ifdef __UCLIBC_HAS_THREADS__
  13. libc_hidden_def(errno)
  14. weak_alias(errno, _errno)
  15. libc_hidden_def(h_errno)
  16. weak_alias(h_errno, _h_errno)
  17. #endif
  18. #endif