gerrno.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* $NetBSD: errno.h,v 1.4 2000/12/18 21:22:00 christos Exp $ */
  2. /*
  3. * Copyright (c) 1982, 1986, 1989, 1993
  4. * The Regents of the University of California. All rights reserved.
  5. * (c) UNIX System Laboratories, Inc.
  6. * All or some portions of this file are derived from material licensed
  7. * to the University of California by American Telephone and Telegraph
  8. * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  9. * the permission of UNIX System Laboratories, Inc.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. * 1. Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. * 2. Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. * 3. All advertising materials mentioning features or use of this software
  20. * must display the following acknowledgement:
  21. * This product includes software developed by the University of
  22. * California, Berkeley and its contributors.
  23. * 4. Neither the name of the University nor the names of its contributors
  24. * may be used to endorse or promote products derived from this software
  25. * without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  28. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  29. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  30. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  31. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  33. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  34. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  35. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  36. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  37. * SUCH DAMAGE.
  38. *
  39. * from: @(#)errno.h 8.5 (Berkeley) 1/21/94
  40. */
  41. #ifndef __errno_h
  42. #define __errno_h
  43. #ifndef _ERRNO_H_
  44. /* NOTE : Other middleware uses _ERRNO_H_ macro to check
  45. whether its own errno definition should be used or not. */
  46. #define _ERRNO_H_
  47. #endif /* #ifndef _ERRNO_H_ */
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. #define EPERM 1 /* Operation not permitted */
  52. #define ENOENT 2 /* No such file or directory */
  53. #define ESRCH 3 /* No such process */
  54. #define EINTR 4 /* Interrupted system call */
  55. #define EIO 5 /* Input/output error */
  56. #define ENXIO 6 /* Device not configured */
  57. #define E2BIG 7 /* Argument list too long */
  58. #define ENOEXEC 8 /* Exec format error */
  59. #define EBADF 9 /* Bad file descriptor */
  60. #define ECHILD 10 /* No child processes */
  61. #define EDEADLK 11 /* Resource deadlock avoided */
  62. /* 11 was EAGAIN */
  63. #define ENOMEM 12 /* Cannot allocate memory */
  64. #define EACCES 13 /* Permission denied */
  65. #define EFAULT 14 /* Bad address */
  66. #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
  67. #define ENOTBLK 15 /* Block device required */
  68. #endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
  69. #define EBUSY 16 /* Device busy */
  70. #define EEXIST 17 /* File exists */
  71. #define EXDEV 18 /* Cross-device link */
  72. #define ENODEV 19 /* Operation not supported by device */
  73. #define ENOTDIR 20 /* Not a directory */
  74. #define EISDIR 21 /* Is a directory */
  75. #define EINVAL 22 /* Invalid argument */
  76. #define ENFILE 23 /* Too many open files in system */
  77. #define EMFILE 24 /* Too many open files */
  78. #define ENOTTY 25 /* Inappropriate ioctl for device */
  79. #ifndef _POSIX_SOURCE
  80. #define ETXTBSY 26 /* Text file busy */
  81. #endif /* !_POSIX_SOURCE */
  82. #define EFBIG 27 /* File too large */
  83. #define ENOSPC 28 /* No space left on device */
  84. #define ESPIPE 29 /* Illegal seek */
  85. #define EROFS 30 /* Read-only file system */
  86. #define EMLINK 31 /* Too many links */
  87. #define EPIPE 32 /* Broken pipe */
  88. /* math software */
  89. #define EDOM 33 /* Numerical argument out of domain */
  90. #define ERANGE 34 /* Result too large */
  91. /* non-blocking and interrupt i/o */
  92. #define EAGAIN 35 /* Resource temporarily unavailable */
  93. #ifndef _POSIX_SOURCE
  94. #define EWOULDBLOCK EAGAIN /* Operation would block */
  95. #define EINPROGRESS 36 /* Operation now in progress */
  96. #define EALREADY 37 /* Operation already in progress */
  97. /* ipc/network software -- argument errors */
  98. #define ENOTSOCK 38 /* Socket operation on non-socket */
  99. #define EDESTADDRREQ 39 /* Destination address required */
  100. #define EMSGSIZE 40 /* Message too long */
  101. #define EPROTOTYPE 41 /* Protocol wrong type for socket */
  102. #define ENOPROTOOPT 42 /* Protocol not available */
  103. #define EPROTONOSUPPORT 43 /* Protocol not supported */
  104. #ifndef _XOPEN_SOURCE
  105. #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
  106. #endif /* !_XOPEN_SOURCE */
  107. #define EOPNOTSUPP 45 /* Operation not supported */
  108. #ifndef _XOPEN_SOURCE
  109. #define EPFNOSUPPORT 46 /* Protocol family not supported */
  110. #endif /* !_XOPEN_SOURCE */
  111. #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
  112. #define EADDRINUSE 48 /* Address already in use */
  113. #define EADDRNOTAVAIL 49 /* Can't assign requested address */
  114. /* ipc/network software -- operational errors */
  115. #define ENETDOWN 50 /* Network is down */
  116. #define ENETUNREACH 51 /* Network is unreachable */
  117. #ifndef _XOPEN_SOURCE
  118. #define ENETRESET 52 /* Network dropped connection on reset */
  119. #endif /* !_XOPEN_SOURCE */
  120. #define ECONNABORTED 53 /* Software caused connection abort */
  121. #define ECONNRESET 54 /* Connection reset by peer */
  122. #define ENOBUFS 55 /* No buffer space available */
  123. #define EISCONN 56 /* Socket is already connected */
  124. #define ENOTCONN 57 /* Socket is not connected */
  125. #ifndef _XOPEN_SOURCE
  126. #define ESHUTDOWN 58 /* Can't send after socket shutdown */
  127. #define ETOOMANYREFS 59 /* Too many references: can't splice */
  128. #endif /* !_XOPEN_SOURCE */
  129. #define ETIMEDOUT 60 /* Operation timed out */
  130. #define ECONNREFUSED 61 /* Connection refused */
  131. #define ELOOP 62 /* Too many levels of symbolic links */
  132. #endif /* !_POSIX_SOURCE */
  133. #define ENAMETOOLONG 63 /* File name too long */
  134. /* should be rearranged */
  135. #ifndef _POSIX_SOURCE
  136. #ifndef _XOPEN_SOURCE
  137. #define EHOSTDOWN 64 /* Host is down */
  138. #endif /* !_XOPEN_SOURCE */
  139. #define EHOSTUNREACH 65 /* No route to host */
  140. #endif /* !_POSIX_SOURCE */
  141. #define ENOTEMPTY 66 /* Directory not empty */
  142. /* quotas & mush */
  143. #ifndef _POSIX_SOURCE
  144. #ifndef _XOPEN_SOURCE
  145. #define EPROCLIM 67 /* Too many processes */
  146. #define EUSERS 68 /* Too many users */
  147. #endif /* !_XOPEN_SOURCE */
  148. #define EDQUOT 69 /* Disc quota exceeded */
  149. /* Network File System */
  150. #define ESTALE 70 /* Stale NFS file handle */
  151. #ifndef _XOPEN_SOURCE
  152. #define EREMOTE 71 /* Too many levels of remote in path */
  153. #define EBADRPC 72 /* RPC struct is bad */
  154. #define ERPCMISMATCH 73 /* RPC version wrong */
  155. #define EPROGUNAVAIL 74 /* RPC prog. not avail */
  156. #define EPROGMISMATCH 75 /* Program version wrong */
  157. #define EPROCUNAVAIL 76 /* Bad procedure for program */
  158. #endif /* !_XOPEN_SOURCE */
  159. #endif /* !_POSIX_SOURCE */
  160. #define ENOLCK 77 /* No locks available */
  161. #define ENOSYS 78 /* Function not implemented */
  162. #if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
  163. #define EFTYPE 79 /* Inappropriate file type or format */
  164. #define EAUTH 80 /* Authentication error */
  165. #define ENEEDAUTH 81 /* Need authenticator */
  166. #endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
  167. /* SystemV IPC */
  168. #ifndef _POSIX_SOURCE
  169. #define EIDRM 82 /* Identifier removed */
  170. #define ENOMSG 83 /* No message of desired type */
  171. #define EOVERFLOW 84 /* Value too large to be stored in data type */
  172. #endif /* !_POSIX_SOURCE */
  173. /* Wide/multibyte-character handling, ISO/IEC 9899/AMD1:1995 */
  174. #define EILSEQ 85 /* Illegal byte sequence */
  175. #define ENOTSUP 86 /* Not supported */
  176. #define ECANCELED 87 /* Operation canceled */
  177. #define ELAST 87 /* Must equal largest errno */
  178. #ifdef _KERNEL
  179. /* pseudo-errors returned inside kernel to modify return to process */
  180. #define ERESTART -1 /* restart syscall */
  181. #define EJUSTRETURN -2 /* don't modify regs, just return */
  182. #endif
  183. #ifdef __cplusplus
  184. }
  185. #endif
  186. #endif /* !__errno_h */