home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / unixlib / h / errno < prev    next >
Encoding:
Text File  |  2006-09-17  |  6.3 KB  |  170 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/errno.h,v $
  4.  * $Date: 2005/04/19 18:30:43 $
  5.  * $Revision: 1.18 $
  6.  * $State: Exp $
  7.  * $Author: nick $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. /* ANSI Standard 4.1.3: Errors <errno.h> */
  12.  
  13. #ifndef __ERRNO_H
  14. #define __ERRNO_H
  15.  
  16. #ifndef __UNIXLIB_FEATURES_H
  17. #include <features.h>
  18. #endif
  19.  
  20. #define EPERM        1 /* Operation not permitted.  */
  21. #define ENOENT        2 /* No such file or directory.  */
  22. #define ESRCH        3 /* No such process.  */
  23. #define EINTR        4 /* Interrupted function call. */
  24. #define EIO        5 /* Input/output error.  */
  25. #define ENXIO        6 /* No such device or address (device not configured).  */
  26. #define E2BIG        7 /* Argument list too long.  */
  27. #define ENOEXEC        8 /* Invalid executable file format (exec format error). */
  28. #define EBADF        9 /* Bad file descriptor.  */
  29. #define ECHILD        10 /* There are no child processes.  */
  30. #define EAGAIN        11 /* Resource temporarily unavailable.  */
  31. #define ENOMEM        12 /* Cannot allocate memory.  */
  32.  
  33. /* Permission denied.
  34.    File permissions do not allow the attempted operation.  */
  35. #define EACCES        13
  36. #define EFAULT        14 /* Bad address. An invalid pointer was detected.  */
  37. #define ENOTBLK        15 /* Block device required.  */
  38.  
  39. /* Device busy. Caused by a system resource that can't be shared
  40.    is already in use.  */
  41. #define EBUSY        16
  42. #define EEXIST        17 /* File exists.  */
  43. #define EXDEV        18 /* Invalid cross-device link.  */
  44. #define ENODEV        19 /* Operation not supported by device.  */
  45. #define ENOTDIR     20 /* Not a directory.  */
  46. #define EISDIR        21 /* Is a directory.  */
  47. #define EINVAL        22 /* Invalid argument.  */
  48. #define ENFILE        23 /* Too many open files in system.  */
  49. #define EMFILE        24 /* Too many open files.  */
  50. #define ENOTTY        25 /* Inappropriate ioctl for device.  */
  51. #define ETXTBSY     26 /* Text file busy.  */
  52. #define EFBIG        27 /* File too large.  */
  53. #define ENOSPC        28 /* No space left on device.  */
  54. #define ESPIPE        29 /* Illegal seek.  */
  55. #define EROFS        30 /* Read-only filing system.  */
  56. #define EMLINK        31 /* Too many links.  */
  57. #define EPIPE        32 /* Broken pipe.  */
  58. #define EDOM        33 /* Domain error.  */
  59. #define ERANGE        34 /* Range error.  */
  60. #define EWOULDBLOCK    35 /* Operation would block.  */
  61. #define EINPROGRESS    36 /* Operation now in progress.  */
  62. #define EALREADY    37 /* Operation already in progress.  */
  63. #define ENOTSOCK    38 /* Socket operation on non-socket.  */
  64. #define EDESTADDRREQ    39 /* Destination address required.  */
  65. #define EMSGSIZE    40 /* Message too long.  */
  66. #define EPROTOTYPE    41 /* Protocol wrong type for socket.  */
  67. #define ENOPROTOOPT    42 /* Option not supported by protocol.  */
  68. #define EPROTONOSUPPORT    43 /* Protocol not supported */
  69. #define ESOCKTNOSUPPORT    44 /* Socket type not supported */
  70. #define EOPNOTSUPP    45 /* Operation not supported */
  71. #define EPFNOSUPPORT    46 /* Protocol family not supported.  */
  72. #define EAFNOSUPPORT    47 /* Address family not supported by protocol family. */
  73. #define EADDRINUSE    48 /* Address already in use */
  74. #define EADDRNOTAVAIL    49 /* Can't assign requested address.  */
  75. #define ENETDOWN    50 /* Network is down.  */
  76. #define ENETUNREACH    51 /* Network unreachable */
  77. #define ENETRESET      52 /* Network dropped connection on reset.  */
  78. #define ECONNABORTED    53 /* Software caused connection abort.  */
  79. #define ECONNRESET    54 /* Connection reset by peer */
  80. #define ENOBUFS        55 /* No buffer space available */
  81. #define EISCONN        56 /* Socket is already connected */
  82. #define ENOTCONN    57 /* Socket is not connected */
  83. #define ESHUTDOWN    58 /* Can't send after socket shutdown.  */
  84. #define ETOOMANYREFS    59 /* Too many references: can't splice.  */
  85. #define ETIMEDOUT    60 /* Connection timed out.  */
  86. #define ECONNREFUSED    61 /* Connection refused */
  87. #define EREFUSED    61 /* Acorn Internet name.  */
  88. #define ELOOP        62 /* Too many levels of symbolic links.  */
  89. #define ENAMETOOLONG    63 /* File name too long.  */
  90. #define EHOSTDOWN    64 /* Host is down.  */
  91. #define EHOSTUNREACH    65 /* Host unreachable.  */
  92. #define ENOTEMPTY    66 /* Directory not empty.  */
  93. #define EPROCLIM    67 /* Too many processes.  */
  94. #define EUSERS        68 /* Too many users.  */
  95. #define EDQUOT        69 /* Disc quota exceeded.  */
  96. #define ESTALE        70 /* Stale NFS file handle.  */
  97. #define EREMOTE        71 /* Too many levels of remote in path.  */
  98. #define ENOSTR        72 /* Not a stream device.  */
  99. #define ETIME        73 /* Timer expired.  */
  100. #define ENOSR        74 /* Out of stream resources.  */
  101. #define ENOMSG        75 /* No message of desired type.  */
  102. #define EBADMSG        76 /* Not a data message.  */
  103. #define EIDRM        77 /* Identifier removed.  */
  104. #define EDEADLK        78 /* Deadlock situation detected/avoided.  */
  105. #define ENOLCK        79 /* No record locks available.  */
  106. #define ELIBVER        82 /* Wrong version of shared library.  */
  107. #define ELIBACC        83 /* Permission denied (shared library).  */
  108. #define ELIBLIM        84 /* Shared libraries nested too deeply.  */
  109. #define ELIBNOENT    85 /* Shared library file not found.  */
  110. #define ELIBNOEXEC    86 /* Shared library exec format error.  */
  111. #define ENOSYS        87 /* Function not implemented.  */
  112.  
  113. #define EOPSYS        88 /* RISC OS operating system error.  */
  114. #define ESIG        89
  115. #define EILSEQ        90 /* Invalid multibyte sequence.  */
  116.  
  117. #define __SYS_NERR    90
  118.  
  119. #undef errno
  120.  
  121. #if __UNIXLIB_FEATURE_PTHREADS && __UNIXLIB_ERRNO_THREADED
  122. /* Errno is thread local.  */
  123.  
  124. #ifndef __pthread_t_defined
  125. #define __need_pthread_t
  126. #include <pthread.h>
  127. #endif
  128.  
  129. #define errno __pthread_running_thread->thread_errno
  130. #define __errno __pthread_running_thread->thread_errno
  131. #else
  132. /* Build options specify that errno should be global and not per-thread.  */
  133. extern int errno;
  134. #define errno errno
  135. #define __errno errno
  136. #endif
  137.  
  138. extern const char *sys_errlist[];
  139. extern int sys_nerr;
  140.  
  141. #ifdef __UNIXLIB_INTERNALS
  142. /* This macro should be used whenever errno is to be set. This permits
  143.    us to easily make setting the errno call a function if necessary if
  144.    threads ever appear.  We also give a return value so we can use
  145.    return __set_errno () which can allow function tail calling.  */
  146.  
  147. #if __UNIXLIB_FEATURE_PTHREADS && __UNIXLIB_ERRNO_THREADED
  148. #define __set_errno(val) (__pthread_running_thread->thread_errno = (val), -1)
  149. #else
  150. #define __set_errno(val) (errno = (val), -1)
  151. #endif
  152.  
  153. extern struct
  154. {
  155.   void *pc;
  156.   int errnum;
  157.   char errmess[252];
  158.   int valid;
  159. } __ul_errbuf;
  160.  
  161. extern struct
  162. {
  163.   int fpsr;
  164.   double f[8];
  165. } __ul_fp_registers;
  166.  
  167. #endif /* __UNIXLIB_INTERNALS */
  168.  
  169. #endif
  170.