errno.c 483 B

1234567891011121314151617181920212223242526272829
  1. #if 0
  2. #include <features.h>
  3. /* Unforunately, this produces noisy warnings... */
  4. int errno __attribute__ ((section (".bss")));
  5. int h_errno __attribute__ ((section (".bss")));
  6. weak_alias(errno, _errno);
  7. weak_alias(h_errno, _h_errno);
  8. #else
  9. __asm__("
  10. .weak _errno;
  11. _errno = errno
  12. .weak _h_errno;
  13. _h_errno = h_errno
  14. .bss
  15. .globl errno
  16. .type errno,%object
  17. .size errno,4
  18. errno:
  19. .space 4
  20. .bss
  21. .globl h_errno
  22. .type h_errno,%object
  23. .size h_errno,4
  24. h_errno:
  25. .space 4
  26. ");
  27. #endif