errno.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Error constants. Linux specific version.
  2. Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifdef _ERRNO_H
  17. # include <bits/errno_values.h>
  18. #ifndef ENOTSUP
  19. # define ENOTSUP EOPNOTSUPP
  20. #endif
  21. #ifndef ECANCELED
  22. # define ECANCELED 125
  23. #endif
  24. # ifndef __ASSEMBLER__
  25. /* We now need a declaration of the `errno' variable. */
  26. extern int errno;
  27. /* Function to get address of global `errno' variable. */
  28. extern int *__errno_location (void) __THROW __attribute__ ((__const__));
  29. # if defined _LIBC
  30. /* We wouldn't need a special macro anymore but it is history. */
  31. # define __set_errno(val) ((errno) = (val))
  32. # endif /* _LIBC */
  33. # if defined __UCLIBC_HAS_THREADS__
  34. /* When using threads, errno is a per-thread value. */
  35. # define errno (*__errno_location ())
  36. # endif
  37. # endif /* !__ASSEMBLER__ */
  38. #endif /* _ERRNO_H */