uClibc_errno.h 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #ifndef _BITS_UCLIBC_ERRNO_H
  7. #define _BITS_UCLIBC_ERRNO_H 1
  8. #ifdef IS_IN_rtld
  9. # undef errno
  10. # define errno _dl_errno
  11. extern int _dl_errno; /* attribute_hidden; */
  12. #elif defined __UCLIBC_HAS_THREADS__
  13. # include <tls.h>
  14. # if defined USE___THREAD && USE___THREAD
  15. # undef errno
  16. # ifndef NOT_IN_libc
  17. # define errno __libc_errno
  18. # else
  19. # define errno errno
  20. # endif
  21. extern __thread int errno attribute_tls_model_ie;
  22. # endif /* USE___THREAD */
  23. #endif /* IS_IN_rtld */
  24. #define __set_errno(val) (errno = (val))
  25. #ifndef __ASSEMBLER__
  26. extern int *__errno_location (void) __THROW __attribute__ ((__const__))
  27. # ifdef IS_IN_rtld
  28. attribute_hidden
  29. # endif
  30. ;
  31. # if defined __UCLIBC_HAS_THREADS__
  32. # include <tls.h>
  33. # if defined USE___THREAD && USE___THREAD
  34. libc_hidden_proto(__errno_location)
  35. # endif
  36. # endif
  37. #endif /* !__ASSEMBLER__ */
  38. #endif