?? intro.2
字號:
.\" Copyright (c) 1993, 1980198319861991.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)intro.2 8.3 (Berkeley) 12/11/93.\".Dd December 11, 1993.Dt INTRO 2.Os BSD 4.Sh NAME.Nm intro.Nd introduction to system calls and error numbers.Sh SYNOPSIS.Fd #include <sys/errno.h>.Sh DESCRIPTIONThis section provides an overview of the system calls,their error returns, and other common definitions and concepts..\".Pp.\".Sy System call restart.\".Pp.\"<more later...>.Sh DIAGNOSTICSNearly all of the system calls provide an error number in the externalvariable.Va errno ,which is defined as:.Pp.Dl extern int errno.PpWhen a system call detects an error,it returns an integer valueindicating failure (usually -1)and sets the variable.Va errnoaccordingly.<This allows interpretation of the failure on receivinga -1 and to take action accordingly.>Successful calls never set.Va errno ;once set, it remains until another error occurs.It should only be examined after an error.Note that a number of system calls overload the meanings of theseerror numbers, and that the meanings must be interpreted accordingto the type and circumstances of the call..PpThe following is a complete list of the errors and theirnames as given in.Aq Pa sys/errno.h ..Bl -hang -width Ds.It Er 0 Em "Error 0" .Not used..It Er 1 EPERM Em "Operation not permitted" .An attempt was made to perform an operation limited to processeswith appropriate privileges or to the owner of a file or otherresources..It Er 2 ENOENT Em "No such file or directory" .A component of a specified pathname did not exist, or the pathname was an empty string..It Er 3 ESRCH Em "No such process" .No process could be found corresponding to that specified by the givenprocess ID..It Er 4 EINTR Em "Interrupted function call" .An asynchronous signal (such as.Dv SIGINTor.Dv SIGQUIT )was caught by the process during the execution of an interruptiblefunction. If the signal handler performs a normal return, theinterrupted function call will seem to have returned the error condition..It Er 5 EIO Em "Input/output error" .Some physical input or output error occurred.This error will not be reported until a subsequent operation on the same filedescriptor and may be lost (over written) by any subsequent errors..It Er 6 ENXIO Em "\&No such device or address" .Input or output on a special file referred to a device that did notexist, ormade a request beyond the limits of the device.This error may also occur when, for example,a tape drive is not online or no disk pack isloaded on a drive..It Er 7 E2BIG Em "Arg list too long" .The number of bytes used for the argument and environmentlist of the new process exceeded the current limitof 20480 bytes.Pf ( Dv NCARGSin.Aq Pa sys/param.h ) ..It Er 8 ENOEXEC Em "Exec format error" .A request was made to execute a filethat, although it has the appropriate permissions,was not in the format required for anexecutable file..It Er 9 EBADF Em "Bad file descriptor" .A file descriptor argument was out of range, referred to no open file,or a read (write) request was made to a file that was only open forwriting (reading)..It Er 10 ECHILD Em "\&No child processes" .A.Xr waitor.Xr waitpidfunction was executed by a process that had no existing or unwaited-forchild processes..It Er 11 EDEADLK Em "Resource deadlock avoided" .An attempt was made to lock a system resource thatwould have resulted in a deadlock situation..It Er 12 ENOMEM Em "Cannot allocate memory" .The new process image required more memory than was allowed by the hardwareor by system-imposed memory management constraints.A lack of swap space is normally temporary; however,a lack of core is not.Soft limits may be increased to their corresponding hard limits..It Er 13 EACCES Em "Permission denied" .An attempt was made to access a file in a way forbiddenby its file access permissions..It Er 14 EFAULT Em "Bad address" .The system detected an invalid address in attempting touse an argument of a call..It Er 15 ENOTBLK Em "Not a block device" .A block device operation was attempted on a non-block device or file..It Er 16 EBUSY Em "Resource busy" .An attempt to use a system resource which was in use at the timein a manner which would have conflicted with the request..It Er 17 EEXIST Em "File exists" .An existing file was mentioned in an inappropriate context,for instance, as the new link name in a.Xr linkfunction..It Er 18 EXDEV Em "Improper link" .A hard link to a file on another file systemwas attempted..It Er 19 ENODEV Em "Operation not supported by device" .An attempt was made to apply an inappropriatefunction to a device,for example,trying to read a write-only device such as a printer..It Er 20 ENOTDIR Em "Not a directory" .A component of the specified pathname existed, but it wasnot a directory, when a directory was expected..It Er 21 EISDIR Em "Is a directory" .An attempt was made to open a directory with write mode specified..It Er 22 EINVAL Em "Invalid argument" .Some invalid argument was supplied. (For example,specifying an undefined signal to a.Xr signalor.Xr killfunction)..It Er 23 ENFILE Em "Too many open files in system" .Maximum number of file descriptors allowable on the systemhas been reached and a requests for an open cannot be satisfieduntil at least one has been closed..It Er 24 EMFILE Em "Too many open files" .<As released, the limit on the number ofopen files per process is 64.>.Xr Getdtablesize 2will obtain the current limit..It Er 25 ENOTTY Em "Inappropriate ioctl for device" .A control function (see.Xr ioctl 2 )was attempted for a file orspecial device for which the operation was inappropriate..It Er 26 ETXTBSY Em "Text file busy" .The new process was a pure procedure (shared text) filewhich was open for writing by another process, orwhile the pure procedure file was being executed an.Xr opencall requested write access..It Er 27 EFBIG Em "File too large" .The size of a file exceeded the maximum (about.if t 2\u\s-231\s+2\d.if n 2.1E9bytes)..It Er 28 ENOSPC Em "Device out of space" .A.Xr writeto an ordinary file, the creation of adirectory or symbolic link, or the creation of a directoryentry failed because no more disk blocks were availableon the file system, or the allocation of an inode for a newlycreated file failed because no more inodes were availableon the file system..It Er 29 ESPIPE Em "Illegal seek" .An.Xr lseekfunction was issued on a socket, pipe or.Tn FIFO ..It Er 30 EROFS Em "Read-only file system" .An attempt was made to modify a file or directorywas madeon a file system that was read-only at the time..It Er 31 EMLINK Em "Too many links" .Maximum allowable hard links to a single file has been exceeded (limitof 32767 hard links per file)..It Er 32 EPIPE Em "Broken pipe" .A write on a pipe, socket or.Tn FIFOfor which there is no processto read the data..It Er 33 EDOM Em "Numerical argument out of domain" .A numerical input argument was outside the defined domain of the mathematicalfunction..It Er 34 ERANGE Em "Numerical result out of range" .A numerical result of the function was too large to fit in theavailable space (perhaps exceeded precision)..It Er 35 EAGAIN Em "Resource temporarily unavailable" .This is a temporary condition and later calls to thesame routine may complete normally..It Er 36 EINPROGRESS Em "Operation now in progress" .An operation that takes a long time to complete (such asa.Xr connect 2 )was attempted on a non-blocking object (see.Xr fcntl 2 ) ..It Er 37 EALREADY Em "Operation already in progress" .An operation was attempted on a non-blocking object that alreadyhad an operation in progress..It Er 38 ENOTSOCK Em "Socket operation on non-socket" .Self-explanatory..It Er 39 EDESTADDRREQ Em "Destination address required" .A required address was omitted from an operation on a socket..It Er 40 EMSGSIZE Em "Message too long" .A message sent on a socket was larger than the internal message bufferor some other network limit..It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" .A protocol was specified that does not support the semantics of thesocket type requested. For example, you cannot use the.Tn ARPAInternet.Tn UDPprotocol with type.Dv SOCK_STREAM ..It Er 42 ENOPROTOOPT Em "Protocol not available" .A bad option or level was specified in a.Xr getsockopt 2or.Xr setsockopt 2call..It Er 43 EPROTONOSUPPORT Em "Protocol not supported" .The protocol has not been configured into thesystem or no implementation for it exists..It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" .The support for the socket type has not been configured into thesystem or no implementation for it exists..It Er 45 EOPNOTSUPP Em "Operation not supported" .The attempted operation is not supported for the type of object referenced.Usually this occurs when a file descriptor refers to a file or socketthat cannot support this operation,for example, trying to.Em accepta connection on a datagram socket..It Er 46 EPFNOSUPPORT Em "Protocol family not supported" .The protocol family has not been configured into thesystem or no implementation for it exists..It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" .An address incompatible with the requested protocol was used.For example, you shouldn't necessarily expect to be able to use.Tn NSaddresses with.Tn ARPAInternet protocols..It Er 48 EADDRINUSE Em "Address already in use" .Only one usage of each address is normally permitted..It Er 49 EADDRNOTAVAIL Em "Cannot assign requested address" .Normally results from an attempt to create a socket with anaddress not on this machine..It Er 50 ENETDOWN Em "Network is down" .A socket operation encountered a dead network..It Er 51 ENETUNREACH Em "Network is unreachable" .A socket operation was attempted to an unreachable network..It Er 52 ENETRESET Em "Network dropped connection on reset" .The host you were connected to crashed and rebooted..It Er 53 ECONNABORTED Em "Software caused connection abort" .A connection abort was caused internal to your host machine..It Er 54 ECONNRESET Em "Connection reset by peer" .A connection was forcibly closed by a peer. This normallyresults from a loss of the connection on the remote socketdue to a timeout or a reboot..It Er 55 ENOBUFS Em "\&No buffer space available" .An operation on a socket or pipe was not performed becausethe system lacked sufficient buffer space or because a queue was full..It Er 56 EISCONN Em "Socket is already connected" .A.Xr connectrequest was made on an already connected socket; or,a.Xr sendtoor.Xr sendmsgrequest on a connected socket specified a destinationwhen already connected..It Er 57 ENOTCONN Em "Socket is not connected" .An request to send or receive data was disallowed becausethe socket was not connected and (when sending on a datagram socket)no address was supplied..It Er 58 ESHUTDOWN Em "Cannot send after socket shutdown" .A request to send data was disallowed because the sockethad already been shut down with a previous.Xr shutdown 2call..It Er 60 ETIMEDOUT Em "Operation timed out" .A.Xr connector.Xr sendrequest failed because the connected party did notproperly respond after a period of time. (The timeoutperiod is dependent on the communication protocol.)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -