errno.h 7.4 KB

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