📄 xsh_chap02_03.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>System Interfaces Chapter 2</title></head><body><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1-2001</font></center><hr size="2" noshade><h3><a name="tag_02_03"></a>Error Numbers</h3><p>Most functions can provide an error number. The means by which each function provides its error numbers is specified in itsdescription.</p><p>Some functions provide the error number in a variable accessed through the symbol <i>errno</i>. The symbol <i>errno</i>, definedby including the <a href="../basedefs/errno.h.html"><i><errno.h></i></a> header, expands to a modifiable lvalue of type<b>int</b>. It is unspecified whether <i>errno</i> is a macro or an identifier declared with external linkage. If a macrodefinition is suppressed in order to access an actual object, or a program defines an identifier with the name <i>errno</i>, thebehavior is undefined.</p><p>The value of <i>errno</i> should only be examined when it is indicated to be valid by a function's return value. No function inthis volume of IEEE Std 1003.1-2001 shall set <i>errno</i> to zero. For each thread of a process, the value of<i>errno</i> shall not be affected by function calls or assignments to <i>errno</i> by other threads.</p><p>Some functions return an error number directly as the function value. These functions return a value of zero to indicatesuccess.</p><p>If more than one error occurs in processing a function call, any one of the possible errors may be returned, as the order ofdetection is undefined.</p><p>Implementations may support additional errors not included in this list, may generate errors included in this list undercircumstances other than those described here, or may contain extensions or limitations that prevent some errors from occurring.The ERRORS section on each reference page specifies whether an error shall be returned, or whether it may be returned.Implementations shall not generate a different error number from the ones described here for error conditions described in thisvolume of IEEE Std 1003.1-2001, but may generate additional errors unless explicitly disallowed for a particularfunction.</p><p>Each implementation shall document, in the conformance document, situations in which each of the optional conditions defined inIEEE Std 1003.1-2001 is detected. The conformance document may also contain statements that one or more of the optionalerror conditions are not detected.</p><p>For functions under the Threads option for which [EINTR] is not listed as a possible error condition in this volume ofIEEE Std 1003.1-2001, an implementation shall not return an error code of [EINTR].</p><p>The following symbolic names identify the possible error numbers, in the context of the functions specifically defined in thisvolume of IEEE Std 1003.1-2001; these general descriptions are more precisely defined in the ERRORS sections of thefunctions that return them. Only these symbolic names should be used in programs, since the actual value of the error number isunspecified. All values listed in this section shall be unique integer constant expressions with type <b>int</b> suitable for usein <b>#if</b> preprocessing directives, except as noted below. The values for all these names shall be found in the <a href="../basedefs/errno.h.html"><i><errno.h></i></a> header defined in the Base Definitions volume ofIEEE Std 1003.1-2001. The actual values are unspecified by this volume of IEEE Std 1003.1-2001.</p><dl compact><dt>[E2BIG]</dt><dd>Argument list too long. The sum of the number of bytes used by the new process image's argument list and environment list isgreater than the system-imposed limit of {ARG_MAX} bytes. <p>or:</p><p>Lack of space in an output buffer.</p><p>or:</p><p>Argument is greater than the system-imposed maximum.</p></dd><dt>[EACCES]</dt><dd>Permission denied. An attempt was made to access a file in a way forbidden by its file access permissions.</dd><dt>[EADDRINUSE]</dt><dd>Address in use. The specified address is in use.</dd><dt>[EADDRNOTAVAIL]</dt><dd>Address not available. The specified address is not available from the local system.</dd><dt>[EAFNOSUPPORT]</dt><dd>Address family not supported. The implementation does not support the specified address family, or the specified address is not avalid address for the address family of the specified socket.</dd><dt>[EAGAIN]</dt><dd>Resource temporarily unavailable. This is a temporary condition and later calls to the same routine may complete normally.</dd><dt>[EALREADY]</dt><dd>Connection already in progress. A connection request is already in progress for the specified socket.</dd><dt>[EBADF]</dt><dd>Bad file descriptor. A file descriptor argument is out of range, refers to no open file, or a read (write) request is made to afile that is only open for writing (reading).</dd><dt>[EBADMSG]</dt><dd><sup>[<a href="javascript:open_code('XSR')">XSR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Badmessage. During a <a href="../functions/read.html"><i>read</i>()</a>, <a href="../functions/getmsg.html"><i>getmsg</i>()</a>, <ahref="../functions/getpmsg.html"><i>getpmsg</i>()</a>, or <a href="../functions/ioctl.html"><i>ioctl</i>()</a> I_RECVFD request toa STREAMS device, a message arrived at the head of the STREAM that is inappropriate for the function receiving the message. <dl compact><dt><i>read</i>()</dt><dd>Message waiting to be read on a STREAM is not a data message.</dd><dt><i>getmsg</i>() or <i>getpmsg</i>()</dt><dd>A file descriptor was received instead of a control message.</dd><dt><i>ioctl</i>()</dt><dd>Control or data information was received instead of a file descriptor when I_RECVFD was specified. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl><p>or:</p><p>Bad Message. The implementation has detected a corrupted message.</p></dd><dt>[EBUSY]</dt><dd>Resource busy. An attempt was made to make use of a system resource that is not currently available, as it is being used by anotherprocess in a manner that would have conflicted with the request being made by this process.</dd><dt>[ECANCELED]</dt><dd>Operation canceled. The associated asynchronous operation was canceled before completion.</dd><dt>[ECHILD]</dt><dd>No child process. A <a href="../functions/wait.html"><i>wait</i>()</a> or <a href="../functions/waitpid.html"><i>waitpid</i>()</a>function was executed by a process that had no existing or unwaited-for child process.</dd><dt>[ECONNABORTED]</dt><dd>Connection aborted. The connection has been aborted.</dd><dt>[ECONNREFUSED]</dt><dd>Connection refused. An attempt to connect to a socket was refused because there was no process listening or because the queue ofconnection requests was full and the underlying protocol does not support retransmissions.</dd><dt>[ECONNRESET]</dt><dd>Connection reset. The connection was forcibly closed by the peer.</dd><dt>[EDEADLK]</dt><dd>Resource deadlock would occur. An attempt was made to lock a system resource that would have resulted in a deadlock situation.</dd><dt>[EDESTADDRREQ]</dt><dd>Destination address required. No bind address was established.</dd><dt>[EDOM]</dt><dd>Domain error. An input argument is outside the defined domain of the mathematical function (defined in the ISO Cstandard).</dd><dt>[EDQUOT]</dt><dd>Reserved.</dd><dt>[EEXIST]</dt><dd>File exists. An existing file was mentioned in an inappropriate context; for example, as a new link name in the <a href="../functions/link.html"><i>link</i>()</a> function.</dd><dt>[EFAULT]</dt><dd>Bad address. The system detected an invalid address in attempting to use an argument of a call. The reliable detection of thiserror cannot be guaranteed, and when not detected may result in the generation of a signal, indicating an address violation, whichis sent to the process.</dd><dt>[EFBIG]</dt><dd>File too large. The size of a file would exceed the maximum file size of an implementation or offset maximum established in thecorresponding file description.</dd><dt>[EHOSTUNREACH]</dt><dd>Host is unreachable. The destination host cannot be reached (probably because the host is down or a remote router cannot reachit).</dd><dt>[EIDRM]</dt><dd>Identifier removed. Returned during XSI interprocess communication if an identifier has been removed from the system.</dd><dt>[EILSEQ]</dt><dd>Illegal byte sequence. A wide-character code has been detected that does not correspond to a valid character, or a byte sequencedoes not form a valid wide-character code (defined in the ISO C standard).</dd><dt>[EINPROGRESS]</dt><dd>Operation in progress. This code is used to indicate that an asynchronous operation has not yet completed. <p>or:</p><p>O_NONBLOCK is set for the socket file descriptor and the connection cannot be immediately established.</p></dd><dt>[EINTR]</dt><dd>Interrupted function call. An asynchronous signal was caught by the process during the execution of an interruptible function. Ifthe signal handler performs a normal return, the interrupted function call may return this condition (see the Base Definitionsvolume of IEEE Std 1003.1-2001, <a href="../basedefs/signal.h.html"><i><signal.h></i></a>).</dd><dt>[EINVAL]</dt><dd>Invalid argument. Some invalid argument was supplied; for example, specifying an undefined signal in a <a href="../functions/signal.html"><i>signal</i>()</a> function or a <a href="../functions/kill.html"><i>kill</i>()</a> function.</dd><dt>[EIO]</dt><dd>Input/output error. Some physical input or output error has occurred. This error may be reported on a subsequent operation on thesame file descriptor. Any other error-causing operation on the same file descriptor may cause the [EIO] error indication to belost.</dd><dt>[EISCONN]</dt><dd>Socket is connected. The specified socket is already connected.</dd><dt>[EISDIR]</dt><dd>Is a directory. An attempt was made to open a directory with write mode specified.</dd><dt>[ELOOP]</dt><dd>Symbolic link loop. A loop exists in symbolic links encountered during pathname resolution. This error may also be returned if morethan {SYMLOOP_MAX} symbolic links are encountered during pathname resolution.</dd><dt>[EMFILE]</dt><dd>Too many open files. An attempt was made to open more than the maximum number of file descriptors allowed in this process.</dd><dt>[EMLINK]</dt><dd>Too many links. An attempt was made to have the link count of a single file exceed {LINK_MAX}.</dd><dt>[EMSGSIZE]</dt>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -