errno.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <html>
  2. <head>
  3. <title>errno</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>errno</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. errno - error code reporting
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;errno.h&gt;<br>
  13. <br>
  14. extern int errno;
  15. <h3>Description</h3>
  16. When system calls, and sometimes other functions, fail, a code
  17. representing or describing the error condition is placed in the global
  18. variable errno.
  19. <p>
  20. errno is always left unchanged by successful operations.
  21. <p>
  22. errno may be a macro. In a multithreaded process it is almost
  23. invariably a macro. However, it is always an lvalue, that is, it may
  24. be assigned to.
  25. <p>
  26. Each numeric code has a symbolic name and a textual expansion. The
  27. symbolic names are used in source code; the textual expansions are
  28. printed out when errors are reported to a user.
  29. <p>
  30. The textual expansions can be retrieved with
  31. <A HREF=../libc/strerror.html>strerror</A> or printed with
  32. <A HREF=../libc/err.html>err</A> or <A HREF=../libc/warn.html>warn</A>.
  33. <p>
  34. <h3>Symbolic names</h3>
  35. The following symbolic errors are defined in the OS/161 base system.
  36. You may add more at your pleasure; but be sure to read the notes in
  37. the file kern/errno.h that defines them.
  38. <blockquote>
  39. <table width=90%>
  40. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  41. <tr><td valign=top>ENOSYS</td>
  42. <td>No such system call: the call made was not defined, or perhaps not
  43. yet implemented.</td></tr>
  44. <tr><td valign=top>EUNIMP</td>
  45. <td>Unimplemented feature: functionality not yet implemented would
  46. have been needed to perform the requested operation. This
  47. error code is not found in production systems.</td></tr>
  48. <tr><td valign=top>ENOMEM</td>
  49. <td>Out of memory: a memory allocation failed. This normally means
  50. that a process has used up all the memory available to it
  51. (either because of limits or because it has used up all the
  52. memory available to the system.) It may also mean that memory
  53. allocation within the kernel has failed.</td></tr>
  54. <tr><td valign=top>EAGAIN</td>
  55. <td>Operation would block: some resource is temporarily unavailable,
  56. or a non-blocking I/O operation (if such things exist) could
  57. not be completed without waiting. Historically, the message
  58. was "Try again later"; in 4.4BSD EAGAIN and the old
  59. EWOULDBLOCK code were folded together.</td></tr>
  60. <tr><td valign=top>EINTR</td>
  61. <td>Interrupted system call: handling of a system call was interrupted
  62. by the delivery of a signal. (If you have signals.)</td></tr>
  63. <tr><td valign=top>EFAULT</td>
  64. <td>Bad memory reference: a pointer passed as an argument was not
  65. valid.</td></tr>
  66. <tr><td valign=top>ENAMETOOLONG</td>
  67. <td>String too long: a string passed as an argument was too long to
  68. process.</td></tr>
  69. <tr><td valign=top>EINVAL</td>
  70. <td>Invalid argument: an argument passed to a command or system call
  71. was badly formed, invalid, or nonsensical, in a way for which
  72. some more specific error code is not available.</td></tr>
  73. <tr><td valign=top>EPERM</td>
  74. <td>Operation not permitted: the requested operation is restricted to
  75. privileged users.</td></tr>
  76. <tr><td valign=top>EACCES</td>
  77. <td>Permission denied: the current process's credentials do not allow
  78. the desired form of access to the target object according to
  79. its permission settings.</td></tr>
  80. <tr><td valign=top>EMPROC</td>
  81. <td>Too many processes: the current user ID has reached its limit of
  82. simultaneous running processes. In Unix, tihs is
  83. EPROCLIM.</td></tr>
  84. <tr><td valign=top>ENPROC</td>
  85. <td>Too many processes on system: the system process table is full.
  86. (Void where impossible or prohibited by law.)</td></tr>
  87. <tr><td valign=top>ENOEXEC</td>
  88. <td>File is not executable: an <A HREF=../syscall/execv.html>execv</A>
  89. operation was attempted but the kernel was unable to run the
  90. requested program.</td></tr>
  91. <tr><td valign=top>E2BIG</td>
  92. <td>Argument list too long: the space taken up by the argv[] strings
  93. passed to a newly started program is larger than the system
  94. allows.</td></tr>
  95. <tr><td valign=top>ESRCH</td>
  96. <td>No such process: the supplied process ID does not name any of the
  97. currently running processes.</td></tr>
  98. <tr><td valign=top>ECHILD</td>
  99. <td>No child processes: the current process has no exited child
  100. processes whose exit status has not yet been collected with
  101. <A HREF=../syscall/waitpid.html>waitpid</A>.</td></tr>
  102. <tr><td valign=top>ENOTDIR</td>
  103. <td>Not a directory: a directory was expected and a non-directory
  104. filesystem object was found.</td></tr>
  105. <tr><td valign=top>EISDIR</td>
  106. <td>Is a directory: a non-directory was expected and a directory was
  107. found.</td></tr>
  108. <tr><td valign=top>ENOENT</td>
  109. <td>No such file or directory: the requested filesystem object
  110. does/did not exist.</td></tr>
  111. <tr><td valign=top>ELOOP</td>
  112. <td>Too many levels of symbolic links: pathname lookup crossed more
  113. than the maximum allowed number of symbolic links. Usually
  114. means a link points to itself, or a family of links has been
  115. arranged into a loop. (If you have symbolic links.)</td></tr>
  116. <tr><td valign=top>ENOTEMPTY</td>
  117. <td>Directory not empty: a directory must be empty of everything
  118. (except . and ..) before it may be removed.</td></tr>
  119. <tr><td valign=top>EEXIST</td>
  120. <td>File exists: a filesystem object that was expected not to exist
  121. did in fact already exist.</td></tr>
  122. <tr><td valign=top>EMLINK</td>
  123. <td>Too many hard links: the maximum number of hard links to the
  124. target file already exist.</td></tr>
  125. <tr><td valign=top>EXDEV</td>
  126. <td>Cross-device link: an attempt was made to instruct one filesystem
  127. to handle files on another filesystem.</td></tr>
  128. <tr><td valign=top>ENODEV</td>
  129. <td>No such device: the requested device does not exist.</td></tr>
  130. <tr><td valign=top>ENXIO</td>
  131. <td>Device not available: the requested device exists but is not
  132. available (is not mounted, is powered off, etc.)</td></tr>
  133. <tr><td valign=top>EBUSY</td>
  134. <td>Device busy: the requested object cannot be used (or, perhaps,
  135. released) because something else is using it.</td></tr>
  136. <tr><td valign=top>EMFILE</td>
  137. <td>Too many open files: the process file table is full, so the
  138. process cannot open more files.</td></tr>
  139. <tr><td valign=top>ENFILE</td>
  140. <td>Too many open files in system: a system-wide limit of some sort,
  141. if any exists, on the number of open files has been
  142. reached.</td></tr>
  143. <tr><td valign=top>EBADF</td>
  144. <td>Bad file number: a file operation was requested on an illegal file
  145. handle, or a file handle that was not open. Or, a write
  146. operation was attempted on a file handle that was open only
  147. for read or vice-versa.</td></tr>
  148. <tr><td valign=top>EIOCTL</td>
  149. <td>Invalid or inappropriate ioctl: an operation requested via the
  150. <A HREF=../syscall/ioctl.html>ioctl</A> system call was not
  151. defined or could not be performed on the indicated
  152. object. In Unix, for historical reasons, this is ENOTTY, with
  153. the historic message "Not a typewriter".</td></tr>
  154. <tr><td valign=top>EIO</td>
  155. <td>Input/output error: a hardware error occured on a device. Media
  156. errors on disks fall into this category.</td></tr>
  157. <tr><td valign=top>ESPIPE</td>
  158. <td>Illegal seek: a seek operation was attempted on a sequential
  159. object where seeking makes no sense, like a
  160. terminal.</td></tr>
  161. <tr><td valign=top>EROFS</td>
  162. <td>Read-only file system: an attempt was made to modify a filesystem
  163. that was mounted read-only. (If you have read-only
  164. mounts.)</td></tr>
  165. <tr><td valign=top>ENOSPC</td>
  166. <td>No space left on device: the target filesystem is full.</td></tr>
  167. <tr><td valign=top>EDQUOT</td>
  168. <td>Disc<font size=-2><i>(sic)</i></font> quota exceeded: the current user ID's quota (of space or
  169. number of files) on the target filesystem has been used up.
  170. (If you have disk quotas.)</td></tr>
  171. <tr><td valign=top>EFBIG</td>
  172. <td>File too large: an attempt was made to exceed the target
  173. filesystem's maximum file size, or a per-user limit on maximum
  174. file size was reached, if such a thing exists.</td></tr>
  175. <tr><td valign=top>EFTYPE</td>
  176. <td>Invalid file type or format: the file provided was the wrong kind
  177. of file or contained invalid syntax.</td></tr>
  178. <tr><td valign=top>EDOM</td>
  179. <td>Argument out of range: the (numeric) argument provided was outside
  180. the values upon which the operation is defined. For example,
  181. attempting to evaluate the logarithm of zero.</td></tr>
  182. <tr><td valign=top>ERANGE</td>
  183. <td>Result out of range: the result of an operation did not fit in the
  184. space provided or could not be represented.</td></tr>
  185. <tr><td valign=top>EILSEQ</td>
  186. <td>Invalid multibyte character sequence: the input string contained a
  187. byte sequence whose value is undefined or whose use is
  188. restricted. Only applicable when a multibyte character set is
  189. in use, and if someone has added locale support.</td></tr>
  190. <tr><td valign=top>ENOTSOCK</td>
  191. <td>Not a socket: the file handle in question does not refer to a
  192. socket, but a socket was expected.</td></tr>
  193. <tr><td valign=top>EISSOCK</td>
  194. <td>Is a socket: the file handle in question refers to a socket, but a
  195. socket was not expected. In Unix this is EOPNOTSUPP,
  196. "Operation not supported on socket".</td></tr>
  197. <tr><td valign=top>ENOTCONN</td>
  198. <td>Socket is not connected: given the protocol in use, the operation
  199. requires a connected socket, but no connection has yet been
  200. made.</td></tr>
  201. <tr><td valign=top>ESHUTDOWN</td>
  202. <td>Socket has been shut down: the operation requires a running
  203. socket, but the socket provided has been closed down.</td></tr>
  204. <tr><td valign=top>EPFNOSUPPORT</td>
  205. <td>Protocol family not supported: the requested protocol family
  206. (PF_INET, PF_LOCAL, etc.) is not supported by the system.</td></tr>
  207. <tr><td valign=top>ESOCKTNOSUPPORT</td>
  208. <td>Socket type not supported: the requested socket type (SOCK_STREAM,
  209. SOCK_DGRAM, etc.) is not supported by the system.</td></tr>
  210. <tr><td valign=top>EPROTONOSUPPORT</td>
  211. <td>Protocol not supported: the protocol requested for a socket was
  212. not one supported by the system.</td></tr>
  213. <tr><td valign=top>EAFNOSUPPORT</td>
  214. <td>Address family not supported by protocol family: the address
  215. family named in a struct sockaddr (AF_INET, AF_LOCAL, etc.) is
  216. not supported by the protocol family used to create the socket
  217. (PF_INET, PF_LOCAL, etc.). In practice each protocol family
  218. has exactly one address family and the values of AF_* and PF_*
  219. are often, if incorrectly, used interchangeably.</td></tr>
  220. <tr><td valign=top>ENOPROTOOPT</td>
  221. <td>Protocol option not available: the protocol option that was
  222. requested is not supported or cannot be activated.</td></tr>
  223. <tr><td valign=top>EADDRINUSE</td>
  224. <td>Address already in use: the requested socket address is already in
  225. use by another socket somewhere on the system.</td></tr>
  226. <tr><td valign=top>EADDRNOTAVAIL</td>
  227. <td>Cannot assign requested address: the requested socket address is
  228. unavailable. Usually caused by attempting to bind a socket to
  229. the IP address of another machine. </td></tr>
  230. <tr><td valign=top>ENETDOWN</td>
  231. <td>Network is down: the network or subnet needed is offline.</td></tr>
  232. <tr><td valign=top>ENETUNREACH</td>
  233. <td>Network is unreachable: the network or subnet needed cannot be
  234. reached from here, possibly due to routing problems on the
  235. network, possibly due to local configuration trouble.</td></tr>
  236. <tr><td valign=top>EHOSTDOWN</td>
  237. <td>Host is down: the specific machine requested is offline.</td></tr>
  238. <tr><td valign=top>EHOSTUNREACH</td>
  239. <td>Host is unreachable: the specific machine requested cannot be
  240. reached from here.</td></tr>
  241. <tr><td valign=top>ECONNREFUSED</td>
  242. <td>Connection refused: the remote machine is not listening for
  243. connections on the requested port.</td></tr>
  244. <tr><td valign=top>ETIMEDOUT</td>
  245. <td>Connection timed out: there was no response from the remote
  246. machine; it may be down, it may not be listening, or it may not be
  247. receiving our packets at all.</td></tr>
  248. <tr><td valign=top>ECONNRESET</td>
  249. <td>Connection reset by peer: the connection was abandoned by the
  250. remote host. Usually seen on already-open connections after
  251. the remote machine reboots and thereby loses its network
  252. state. Sometimes also caused by defective network devices
  253. between the local and remote hosts.</td></tr>
  254. <tr><td valign=top>EMSGSIZE</td>
  255. <td>Message too large: an internal protocol length limit was
  256. exceeded.</td></tr>
  257. <tr><td valign=top>ENOTSUP</td>
  258. <td>Threads operation not supported: a special error code defined by
  259. the POSIX threads standard, which is a "special"
  260. interface.</td></tr>
  261. </table>
  262. </blockquote>
  263. </body>
  264. </html>