📄 errors.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>Error Numbers</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><blockquote><center><h3><a name = "tag_000_004"> </a>Error Numbers</h3></center><xref type="2" name="error"></xref>Most functions can provide an error number. The means by which eachfunction provides its error numbers is specified in its description.<p>Some functions provide the error number in a variable accessed throughthe symbol <i>errno</i>. The symbol <i>errno</i>, defined by includingthe header<i><a href="errno.h.html"><errno.h></a></i>,is a macro that expands to a modifiable lvalue of type <b>int</b>.<p>The value of <i>errno</i> should only be examined when it is indicated to bevalid by a function's return value. No function in this specification sets<i>errno</i> to zero to indicate an error. For each thread of a process, thevalue of <i>errno</i> is not affected by function calls or assignments to<i>errno</i> by other threads.<p>Some functions return an error number directly as the function value.These functions return a value of zero to indicate success.<p>If more than one error occurs in processing a function call,any one of the possible errors may be returned, as the orderof detection is undefined.<p>Implementations may support additional errors not included in thislist, may generate errors included in this list under circumstancesother than those described here, or may contain extensions or limitationsthat prevent some errors from occurring. The ERRORSsection on each page specifies whether an error will be returned,or whether it may be returned. Implementationswill not generate a different error number from the ones described herefor error conditions described in this specification, but maygenerate additional errors unless explicitly disallowed for aparticular function.<p>The following symbolic names identify the possible error numbers,in the context of the functions specifically defined in this specification;these general descriptions are more precisely defined in theERRORS sections of the functions that return them.Only these symbolic names should be used in programs, since theactual value of the error number is unspecified.All values listed in this section are uniqueexcept as noted below.The values for all these names can be found in the header<i><a href="errno.h.html"><errno.h></a></i>.<dl compact><dt>[E2BIG]<dd><index term="E2BIG, "></index>Argument list too longThe sum of the number of bytes used by the new process image's argumentlist and environment list is greater than the system-imposed limitof {ARG_MAX} bytes.<dt>[EACCES]<dd><index term="EACCES, "></index>Permission deniedAn attempt was made to access a file in a way forbidden by its fileaccess permissions.<dt>[EADDRINUSE]<dd><index term="EADDRINUSE, "></index>Address in useThe specified address is in use.<dt>[EADDRNOTAVAIL]<dd><index term="EADDRNOTAVAIL, "></index>Address not availableThe specified address is not available from the local system.<dt>[EAFNOSUPPORT]<dd><index term="EAFNOSUPPORT, "></index>Address family not supportedThe implementation does not support the specified address family, orthe specified address is not a valid address for the address family ofthe specified socket.<dt>[EAGAIN]<dd><index term="EAGAIN, "></index>Resource temporarily unavailableThis is a temporary condition and later calls to the same routinemay complete normally.<dt>[EALREADY]<dd><index term="EALREADY, "></index>Connection already in progressA connection request is already in progress for the specified socket.<dt>[EBADF]<dd><index term="EBADF, "></index>Bad file descriptorA file descriptor argument is out of range, refers to no open file, ora read (write) request is made to a file that is only open forwriting (reading).<dt>[EBADMSG]<dd><index term="EBADMSG, "></index>Bad messageDuring a<i><a href="read.html">read()</a></i>,<i><a href="getmsg.html">getmsg()</a></i>or<i><a href="ioctl.html">ioctl()</a></i>I_RECVFD request to a STREAMS device, a message arrived at the head of theSTREAM that is inappropriate for the function receiving the message.<ul><li><i><a href="read.html">read()</a></i>- message waiting to be read on a STREAM is not a data message.<li><i><a href="getmsg.html">getmsg()</a></i>- a file descriptor was received instead of a control message.<li><i><a href="ioctl.html">ioctl()</a></i>- control or data information was received instead of a filedescriptor when I_RECVFD was specified.</ul><dt>[EBADMSG]<dd><index term="EBADMSG, "></index>Bad MessageThe implementation has detected a corrupted message.<dt>[EBUSY]<dd><index term="EBUSY, "></index>Resource busyAn attempt was made to make use of a system resource that is not currentlyavailable, as it is being used by another process in a mannerthat would have conflicted with the request being made by this process.<dt>[ECANCELED]<dd><index term="ECANCELED, "></index>Operation canceledThe associated asynchronous operation was canceled before completion.<dt>[ECHILD]<dd><index term="ECHILD, "></index>No child processA<i><a href="wait.html">wait()</a></i>or<i><a href="waitpid.html">waitpid()</a></i>function was executed bya process that had no existing or unwaited-for child process.<dt>[ECONNABORTED]<dd><index term="ECONNABORTED, "></index>Connection abortedThe connection has been aborted.<dt>[ECONNREFUSED]<dd><index term="ECONNREFUSED, "></index>Connection refusedAn attempt to connect to a socket was refused because there wasno process listening or because the queue of connection requests was fulland the underlying protocol does not support retransmissions.<dt>[ECONNRESET]<dd><index term="ECONNRESET, "></index>Connection resetThe connection was forcibly closed by the peer.<dt>[EDEADLK]<dd><index term="EDEADLK, "></index>Resource deadlock would occurAn attempt was made to lock a system resource that would have resultedin a deadlock situation.<dt>[EDESTADDRREQ]<dd><index term="EDESTADDRREQ, "></index>Destination address requiredNo bind address was established.<dt>[EDOM]<dd><index term="EDOM, "></index>Domain errorAn input argument is outside the defined domain of the mathematical function.(Defined in the ISO C standard.)<dt>[EDQUOT]<dd><index term="EDQUOT, "></index>Reserved<dt>[EEXIST]<dd><index term="EEXIST, "></index>File existsAn existing file was mentioned in an inappropriate context, for instance, asa new link name in the<i><a href="link.html">link()</a></i>function.<dt>[EFAULT]<dd><index term="EFAULT, "></index>Bad addressThe system detected an invalid address in attempting to use an argument ofa call. The reliable detection of this error cannot be guaranteed,and when not detected may result in the generation of a signal,indicating an address violation, which is sent to the process.<dt>[EFBIG]<dd><index term="EFBIG, "></index>File too largeThe size of a file would exceed the maximum file size of animplementation or offset maximum established in the corresponding filedescription.<dt>[EHOSTUNREACH]<dd>Host is unreachableThe destination host cannot be reached (probably because the host is down or aremote router cannot reach it).<dt>[EIDRM]<dd><index term="EIDRM, "></index>Identifier removedReturned during interprocess communication if an identifier has beenremoved from the system.<dt>[EINPROGRESS]<dd><index term="EINPROGRESS, "></index>Operation in progressThis code is used to indicate that an asynchronous operation has notyet completed.<dt>[EINPROGRESS]<dd><index term="EINPROGRESS, "></index>O_NONBLOCK is set for the socket file descriptor and the connectioncannot be immediately established.<dt>[EILSEQ]<dd><index term="EILSEQ, "></index>Illegal byte sequenceA wide-character code has been detected that does not correspondto a valid character, or a byte sequence does not form a validwide-character code.<dt>[EINTR]<dd><index term="EINTR, "></index>Interrupted function callAn asynchronous signal was caught by the process during the execution ofan interruptible function. If the signal handler performs a normal return,the interrupted function call may return this condition.(See<i><a href="signal.h.html"><signal.h></a></i>.)<dt>[EINVAL]<dd><index term="EINVAL, "></index>Invalid argumentSome invalid argument was supplied; (for example, specifying anundefined signal ina<i><a href="signal.html">signal()</a></i>function or a<i><a href="kill.html">kill()</a></i>function).<dt>[EIO]<dd><index term="EIO, "></index>Input/output errorSome physical input or output error has occurred. This error may bereported on a subsequent operation on the same file descriptor. Anyother error-causing operation on the same file descriptor may causethe [EIO] error indication to be lost.<dt>[EISCONN]<dd><index term="EISCONN, "></index>Socket is connectedThe specified socket is already connected.<dt>[EISDIR]<dd><index term="EISDIR, "></index>Is a directoryAn attempt was made to open a directory with write mode specified.<dt>[ELOOP]<dd><index term="ELOOP, "></index>Too many levels of symbolic linksToo many symbolic links were encountered in resolving a pathname.<dt>[EMFILE]<dd><index term="EMFILE, "></index>Too many open filesAn attempt was made to open more than the maximum number of {OPEN_MAX}file descriptors allowed in this process.<dt>[EMLINK]<dd><index term="EMLINK, "></index>Too many linksAn attempt was made to have the link count of a single file exceed {LINK_MAX}.<dt>[EMSGSIZE]<dd><index term="EMSGSIZE, "></index>Message too large
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -