1*0a6a1f1dSLionel Sambuc.\" $NetBSD: intro.2,v 1.57 2015/04/22 13:59:54 wiz Exp $ 22fe8fb19SBen Gras.\" 32fe8fb19SBen Gras.\" Copyright (c) 1980, 1983, 1986, 1991, 1993 42fe8fb19SBen Gras.\" The Regents of the University of California. All rights reserved. 52fe8fb19SBen Gras.\" 62fe8fb19SBen Gras.\" Redistribution and use in source and binary forms, with or without 72fe8fb19SBen Gras.\" modification, are permitted provided that the following conditions 82fe8fb19SBen Gras.\" are met: 92fe8fb19SBen Gras.\" 1. Redistributions of source code must retain the above copyright 102fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer. 112fe8fb19SBen Gras.\" 2. Redistributions in binary form must reproduce the above copyright 122fe8fb19SBen Gras.\" notice, this list of conditions and the following disclaimer in the 132fe8fb19SBen Gras.\" documentation and/or other materials provided with the distribution. 142fe8fb19SBen Gras.\" 3. Neither the name of the University nor the names of its contributors 152fe8fb19SBen Gras.\" may be used to endorse or promote products derived from this software 162fe8fb19SBen Gras.\" without specific prior written permission. 172fe8fb19SBen Gras.\" 182fe8fb19SBen Gras.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 192fe8fb19SBen Gras.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 202fe8fb19SBen Gras.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 212fe8fb19SBen Gras.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 222fe8fb19SBen Gras.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 232fe8fb19SBen Gras.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 242fe8fb19SBen Gras.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 252fe8fb19SBen Gras.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 262fe8fb19SBen Gras.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 272fe8fb19SBen Gras.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 282fe8fb19SBen Gras.\" SUCH DAMAGE. 292fe8fb19SBen Gras.\" 302fe8fb19SBen Gras.\" @(#)intro.2 8.5 (Berkeley) 2/27/95 312fe8fb19SBen Gras.\" 32*0a6a1f1dSLionel Sambuc.Dd April 21, 2015 332fe8fb19SBen Gras.Dt INTRO 2 342fe8fb19SBen Gras.Os 352fe8fb19SBen Gras.Sh NAME 362fe8fb19SBen Gras.Nm intro , 372fe8fb19SBen Gras.Nm errno 382fe8fb19SBen Gras.Nd introduction to system calls and error numbers 392fe8fb19SBen Gras.Sh SYNOPSIS 402fe8fb19SBen Gras.In errno.h 412fe8fb19SBen Gras.Sh DESCRIPTION 422fe8fb19SBen GrasThis section provides an overview of the system calls, 432fe8fb19SBen Grastheir error returns, and other common definitions and concepts. 442fe8fb19SBen Gras.\".Pp 452fe8fb19SBen Gras.\".Sy System call restart 462fe8fb19SBen Gras.\".Pp 472fe8fb19SBen Gras.\"<more later...> 482fe8fb19SBen Gras.Sh DIAGNOSTICS 492fe8fb19SBen GrasNearly all of the system calls provide an error number in the external 502fe8fb19SBen Grasvariable 512fe8fb19SBen Gras.Va errno . 522fe8fb19SBen Gras.Va errno 532fe8fb19SBen Grasis implemented as a macro which expands to a modifiable lvalue of type 542fe8fb19SBen Gras.Fa int . 552fe8fb19SBen Gras.Pp 562fe8fb19SBen GrasWhen a system call detects an error, 572fe8fb19SBen Grasit returns an integer value 582fe8fb19SBen Grasindicating failure (usually \-1) 592fe8fb19SBen Grasand sets the variable 602fe8fb19SBen Gras.Va errno 612fe8fb19SBen Grasaccordingly. 622fe8fb19SBen Gras(This allows interpretation of the failure on receiving 632fe8fb19SBen Grasa \-1 and to take action accordingly.) 642fe8fb19SBen GrasSuccessful calls never set 652fe8fb19SBen Gras.Va errno ; 662fe8fb19SBen Grasonce set, it remains until another error occurs. 672fe8fb19SBen GrasIt should only be examined after an error has been reported, because 682fe8fb19SBen Grasotherwise a leftover value from some previous error may be found 692fe8fb19SBen Grasinstead. 702fe8fb19SBen Gras.Po 712fe8fb19SBen GrasMany library functions that are not system calls also set 722fe8fb19SBen Gras.Va errno 732fe8fb19SBen Grason return, in the same fashion. 742fe8fb19SBen GrasIn these cases a nonzero value may be left in 752fe8fb19SBen Gras.Va errno 762fe8fb19SBen Graseven upon successful return if some internal action failed. 772fe8fb19SBen Gras.Pc 782fe8fb19SBen Gras.Pp 792fe8fb19SBen GrasThe manual page for each system call will list some of the common 802fe8fb19SBen Graserrno codes that system call can return, but that should not be 812fe8fb19SBen Grasconsidered an exhaustive list, i.e. 822fe8fb19SBen Grasa properly written program should be able to gracefully recover from 832fe8fb19SBen Grasany error that a system call might return. 842fe8fb19SBen GrasDocumenting all the error codes that a system call can return in 852fe8fb19SBen Grasa more specification-like manner would take more resources than 862fe8fb19SBen Grasthis project has available. 872fe8fb19SBen Gras.Pp 882fe8fb19SBen GrasNote also that a number of system calls overload the meanings of these 892fe8fb19SBen Graserror numbers, and that in these cases the meanings must be 902fe8fb19SBen Grasinterpreted according to the type and circumstances of the call. 912fe8fb19SBen Gras.Pp 922fe8fb19SBen GrasThe following is a complete list of the errors and their 932fe8fb19SBen Grasnames as given in 942fe8fb19SBen Gras.In errno.h . 952fe8fb19SBen Gras.Bl -hang -width Ds 962fe8fb19SBen Gras.It Er 0 Em "Error 0" . 972fe8fb19SBen GrasNot used. 982fe8fb19SBen Gras.It Er 1 EPERM Em "Operation not permitted" . 992fe8fb19SBen GrasAn attempt was made to perform an operation limited to processes 1002fe8fb19SBen Graswith appropriate privileges or to the owner of a file or other 1012fe8fb19SBen Grasresources. 1022fe8fb19SBen Gras.It Er 2 ENOENT Em "No such file or directory" . 1032fe8fb19SBen GrasA component of a specified pathname did not exist, or the 1042fe8fb19SBen Graspathname was an empty string. 1052fe8fb19SBen Gras.It Er 3 ESRCH Em "No such process" . 1062fe8fb19SBen GrasNo process could be found corresponding to that specified by the given 1072fe8fb19SBen Grasprocess ID. 1082fe8fb19SBen Gras.It Er 4 EINTR Em "Interrupted function call" . 1092fe8fb19SBen GrasAn asynchronous signal (such as 1102fe8fb19SBen Gras.Dv SIGINT 1112fe8fb19SBen Grasor 1122fe8fb19SBen Gras.Dv SIGQUIT ) 1132fe8fb19SBen Graswas caught by the process during the execution of an interruptible 1142fe8fb19SBen Grasfunction. 1152fe8fb19SBen GrasIf the signal handler performs a normal return, the 1162fe8fb19SBen Grasinterrupted function call will seem to have returned the error condition. 1172fe8fb19SBen Gras.It Er 5 EIO Em "Input/output error" . 1182fe8fb19SBen GrasSome physical input or output error occurred. 1192fe8fb19SBen GrasThis error will not be reported until a subsequent operation on the same file 1202fe8fb19SBen Grasdescriptor and may be lost (over written) by any subsequent errors. 1212fe8fb19SBen Gras.It Er 6 ENXIO Em "Device not configured" . 1222fe8fb19SBen GrasInput or output on a special file referred to a device that did not 1232fe8fb19SBen Grasexist, or 1242fe8fb19SBen Grasmade a request beyond the limits of the device. 1252fe8fb19SBen GrasThis error may also occur when, for example, 1262fe8fb19SBen Grasa tape drive is not online or no disk pack is 1272fe8fb19SBen Grasloaded on a drive. 1282fe8fb19SBen Gras.It Er 7 E2BIG Em "Arg list too long" . 1292fe8fb19SBen GrasThe number of bytes used for the argument and environment 1302fe8fb19SBen Graslist of the new process exceeded the current limit of 1312fe8fb19SBen Gras.if t 2\u\s-218\s+2\d 1322fe8fb19SBen Gras.if n 2**18 1332fe8fb19SBen Grasbytes 1342fe8fb19SBen Gras.Pf ( Dv ARG_MAX 1352fe8fb19SBen Grasin 1362fe8fb19SBen Gras.In sys/syslimits.h ) . 1372fe8fb19SBen Gras.It Er 8 ENOEXEC Em "Exec format error" . 1382fe8fb19SBen GrasA request was made to execute a file 1392fe8fb19SBen Grasthat, although it has the appropriate permissions, 1402fe8fb19SBen Graswas not in the format required for an 1412fe8fb19SBen Grasexecutable file. 1422fe8fb19SBen Gras.It Er 9 EBADF Em "Bad file descriptor" . 1432fe8fb19SBen GrasA file descriptor argument was out of range, referred to no open file, 1442fe8fb19SBen Grashad been revoked by 1452fe8fb19SBen Gras.Xr revoke 2 , 1462fe8fb19SBen Grasor a 1472fe8fb19SBen Gras.Xr read 2 1482fe8fb19SBen Gras(or 1492fe8fb19SBen Gras.Xr write 2 ) 1502fe8fb19SBen Grasrequest was made to a file that was 1512fe8fb19SBen Grasonly open for writing (or reading). 1522fe8fb19SBen Gras.It Er 10 ECHILD Em "\&No child processes" . 1532fe8fb19SBen GrasA 1542fe8fb19SBen Gras.Xr wait 2 1552fe8fb19SBen Grasor 1562fe8fb19SBen Gras.Xr waitpid 2 1572fe8fb19SBen Grasfunction was executed by a process that had no existing or unwaited-for 1582fe8fb19SBen Graschild processes. 1592fe8fb19SBen Gras.It Er 11 EDEADLK Em "Resource deadlock avoided" . 1602fe8fb19SBen GrasAn attempt was made to lock a system resource that 1612fe8fb19SBen Graswould have resulted in a deadlock situation. 1622fe8fb19SBen Gras.It Er 12 ENOMEM Em "Cannot allocate memory" . 1632fe8fb19SBen GrasThe new process image required more memory than was allowed by the hardware 1642fe8fb19SBen Grasor by system-imposed memory management constraints. 1652fe8fb19SBen GrasA lack of swap space is normally temporary; however, 1662fe8fb19SBen Grasa lack of core is not. 1672fe8fb19SBen GrasSoft limits may be increased to their corresponding hard limits. 1682fe8fb19SBen Gras.It Er 13 EACCES Em "Permission denied" . 1692fe8fb19SBen GrasAn attempt was made to access a file in a way forbidden 1702fe8fb19SBen Grasby its file access permissions. 1712fe8fb19SBen Gras.It Er 14 EFAULT Em "Bad address" . 1722fe8fb19SBen GrasThe system detected an invalid address in attempting to 1732fe8fb19SBen Grasuse an argument of a call. 1742fe8fb19SBen GrasThe reliable detection of this error cannot be guaranteed and when not detected 1752fe8fb19SBen Grasmay result in the generation of a signal, indicating an address violation, 1762fe8fb19SBen Graswhich is sent to the process. 1772fe8fb19SBen Gras.It Er 15 ENOTBLK Em "Block device required" . 1782fe8fb19SBen GrasA block device operation was attempted on a non-block device or file. 1792fe8fb19SBen Gras.It Er 16 EBUSY Em "Resource busy" . 1802fe8fb19SBen GrasAn attempt to use a system resource which was in use at the time 1812fe8fb19SBen Grasin a manner which would have conflicted with the request. 1822fe8fb19SBen Gras.It Er 17 EEXIST Em "File exists" . 1832fe8fb19SBen GrasAn existing file was mentioned in an inappropriate context, 1842fe8fb19SBen Grasfor instance, as the new link name in a 1852fe8fb19SBen Gras.Xr link 2 1862fe8fb19SBen Grasfunction. 1872fe8fb19SBen Gras.It Er 18 EXDEV Em "Improper link" . 1882fe8fb19SBen GrasA hard link to a file on another file system 1892fe8fb19SBen Graswas attempted. 1902fe8fb19SBen Gras.It Er 19 ENODEV Em "Operation not supported by device" . 1912fe8fb19SBen GrasAn attempt was made to apply an inappropriate 1922fe8fb19SBen Grasfunction to a device, 1932fe8fb19SBen Grasfor example, 1942fe8fb19SBen Grastrying to read a write-only device such as a printer. 1952fe8fb19SBen Gras.It Er 20 ENOTDIR Em "Not a directory" . 1962fe8fb19SBen GrasA component of the specified pathname existed, but it was 1972fe8fb19SBen Grasnot a directory, when a directory was expected. 1982fe8fb19SBen Gras.It Er 21 EISDIR Em "Is a directory" . 1992fe8fb19SBen GrasAn attempt was made to open a directory with write mode specified. 2002fe8fb19SBen Gras.It Er 22 EINVAL Em "Invalid argument" . 2012fe8fb19SBen GrasSome invalid argument was supplied. 2022fe8fb19SBen Gras(For example, specifying an undefined signal to a 2032fe8fb19SBen Gras.Xr signal 3 2042fe8fb19SBen Grasor 2052fe8fb19SBen Gras.Xr kill 2 2062fe8fb19SBen Grasfunction). 2072fe8fb19SBen Gras.It Er 23 ENFILE Em "Too many open files in system" . 2082fe8fb19SBen GrasMaximum number of file descriptors allowable on the system 2092fe8fb19SBen Grashas been reached and a requests for an open cannot be satisfied 2102fe8fb19SBen Grasuntil at least one has been closed. 2112fe8fb19SBen Gras.It Er 24 EMFILE Em "Too many open files" . 2122fe8fb19SBen Gras\*[Lt]As released, the limit on the number of 2132fe8fb19SBen Grasopen files per process is 64.\*[Gt] 2142fe8fb19SBen GrasThe 2152fe8fb19SBen Gras.Xr getrlimit 2 2162fe8fb19SBen Grascall with the 2172fe8fb19SBen Gras.Ar RLIMIT_NOFILE 2182fe8fb19SBen Grasresource will obtain the current limit. 2192fe8fb19SBen Gras.It Er 25 ENOTTY Em "Inappropriate ioctl for device" . 2202fe8fb19SBen GrasA control function (see 2212fe8fb19SBen Gras.Xr ioctl 2 ) 2222fe8fb19SBen Graswas attempted for a file or 2232fe8fb19SBen Grasspecial device for which the operation was inappropriate. 2242fe8fb19SBen Gras.It Er 26 ETXTBSY Em "Text file busy" . 2252fe8fb19SBen GrasThe new process was a pure procedure (shared text) file 2262fe8fb19SBen Graswhich was open for writing by another process, or 2272fe8fb19SBen Graswhile the pure procedure file was being executed an 2282fe8fb19SBen Gras.Xr open 2 2292fe8fb19SBen Grascall requested write access. 2302fe8fb19SBen Gras.It Er 27 EFBIG Em "File too large" . 2312fe8fb19SBen GrasThe size of a file exceeded the maximum. 2322fe8fb19SBen Gras(The system-wide maximum file size is 2332fe8fb19SBen Gras.if t 2\u\s-263\s+2\d 2342fe8fb19SBen Gras.if n 2**63 2352fe8fb19SBen Grasbytes. 2362fe8fb19SBen GrasEach file system may impose a lower limit for files contained within it). 2372fe8fb19SBen Gras.It Er 28 ENOSPC Em "Device out of space" . 2382fe8fb19SBen GrasA 2392fe8fb19SBen Gras.Xr write 2 2402fe8fb19SBen Grasto an ordinary file, the creation of a 2412fe8fb19SBen Grasdirectory or symbolic link, or the creation of a directory 2422fe8fb19SBen Grasentry failed because no more disk blocks were available 2432fe8fb19SBen Grason the file system, or the allocation of an inode for a newly 2442fe8fb19SBen Grascreated file failed because no more inodes were available 2452fe8fb19SBen Grason the file system. 2462fe8fb19SBen Gras.It Er 29 ESPIPE Em "Illegal seek" . 2472fe8fb19SBen GrasAn 2482fe8fb19SBen Gras.Xr lseek 2 2492fe8fb19SBen Grasfunction was issued on a socket, pipe or 2502fe8fb19SBen Gras.Tn FIFO . 2512fe8fb19SBen Gras.It Er 30 EROFS Em "Read-only file system" . 2522fe8fb19SBen GrasAn attempt was made to modify a file or directory 2532fe8fb19SBen Graswas made 2542fe8fb19SBen Grason a file system that was read-only at the time. 2552fe8fb19SBen Gras.It Er 31 EMLINK Em "Too many links" . 2562fe8fb19SBen GrasThe number of hard links to a single file has exceeded the maximum. 2572fe8fb19SBen Gras(The system-wide maximum number of hard links is 32767. 2582fe8fb19SBen GrasEach file system may impose a lower limit for files contained within it). 2592fe8fb19SBen Gras.It Er 32 EPIPE Em "Broken pipe" . 2602fe8fb19SBen GrasA write on a pipe, socket or 2612fe8fb19SBen Gras.Tn FIFO 2622fe8fb19SBen Grasfor which there is no process 2632fe8fb19SBen Grasto read the data. 2642fe8fb19SBen Gras.It Er 33 EDOM Em "Numerical argument out of domain" . 2652fe8fb19SBen GrasA numerical input argument was outside the defined domain of the mathematical 2662fe8fb19SBen Grasfunction. 2672fe8fb19SBen Gras.It Er 34 ERANGE Em "Result too large or too small" . 2682fe8fb19SBen GrasThe result of the function is too large or too small to be represented 2692fe8fb19SBen Grasin the available space. 2702fe8fb19SBen Gras.It Er 35 EAGAIN Em "Resource temporarily unavailable" . 2712fe8fb19SBen GrasThis is a temporary condition and later calls to the 2722fe8fb19SBen Grassame routine may complete normally. 273*0a6a1f1dSLionel SambucIn this implementation this is the same as 274*0a6a1f1dSLionel Sambuc.Er EWOULDBLOCK , 275*0a6a1f1dSLionel Sambucbut 276*0a6a1f1dSLionel Sambuc.Er EAGAIN 277*0a6a1f1dSLionel Sambucis the preferred name. 2782fe8fb19SBen Gras.It Er 36 EINPROGRESS Em "Operation now in progress" . 2792fe8fb19SBen GrasAn operation that takes a long time to complete (such as 2802fe8fb19SBen Grasa 2812fe8fb19SBen Gras.Xr connect 2 ) 2822fe8fb19SBen Graswas attempted on a non-blocking object (see 2832fe8fb19SBen Gras.Xr fcntl 2 ) . 2842fe8fb19SBen Gras.It Er 37 EALREADY Em "Operation already in progress" . 2852fe8fb19SBen GrasAn operation was attempted on a non-blocking object that already 2862fe8fb19SBen Grashad an operation in progress. 2872fe8fb19SBen Gras.It Er 38 ENOTSOCK Em "Socket operation on non-socket" . 2882fe8fb19SBen GrasSelf-explanatory. 2892fe8fb19SBen Gras.It Er 39 EDESTADDRREQ Em "Destination address required" . 2902fe8fb19SBen GrasA required address was omitted from an operation on a socket. 2912fe8fb19SBen Gras.It Er 40 EMSGSIZE Em "Message too long" . 2922fe8fb19SBen GrasA message sent on a socket was larger than the internal message buffer 2932fe8fb19SBen Grasor some other network limit. 2942fe8fb19SBen Gras.It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" . 2952fe8fb19SBen GrasA protocol was specified that does not support the semantics of the 2962fe8fb19SBen Grassocket type requested. 2972fe8fb19SBen GrasFor example, you cannot use the 2982fe8fb19SBen Gras.Tn ARPA 2992fe8fb19SBen GrasInternet 3002fe8fb19SBen Gras.Tn UDP 3012fe8fb19SBen Grasprotocol with type 3022fe8fb19SBen Gras.Dv SOCK_STREAM . 3032fe8fb19SBen Gras.It Er 42 ENOPROTOOPT Em "Protocol option not available" . 3042fe8fb19SBen GrasA bad option or level was specified in a 3052fe8fb19SBen Gras.Xr getsockopt 2 3062fe8fb19SBen Grasor 3072fe8fb19SBen Gras.Xr setsockopt 2 3082fe8fb19SBen Grascall. 3092fe8fb19SBen Gras.It Er 43 EPROTONOSUPPORT Em "Protocol not supported" . 3102fe8fb19SBen GrasThe protocol has not been configured into the 3112fe8fb19SBen Grassystem or no implementation for it exists. 3122fe8fb19SBen Gras.It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" . 3132fe8fb19SBen GrasThe support for the socket type has not been configured into the 3142fe8fb19SBen Grassystem or no implementation for it exists. 3152fe8fb19SBen Gras.It Er 45 EOPNOTSUPP Em "Operation not supported" . 3162fe8fb19SBen GrasThe attempted operation is not supported for the type of object referenced. 3172fe8fb19SBen GrasUsually this occurs when a file descriptor refers to a file or socket 3182fe8fb19SBen Grasthat cannot support this operation, 3192fe8fb19SBen Grasfor example, trying to 3202fe8fb19SBen Gras.Em accept 3212fe8fb19SBen Grasa connection on a datagram socket. 3222fe8fb19SBen Gras.It Er 46 EPFNOSUPPORT Em "Protocol family not supported" . 3232fe8fb19SBen GrasThe protocol family has not been configured into the 3242fe8fb19SBen Grassystem or no implementation for it exists. 3252fe8fb19SBen Gras.It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" . 3262fe8fb19SBen GrasAn address incompatible with the requested protocol was used. 3272fe8fb19SBen GrasFor example, you shouldn't necessarily expect to be able to use 3282fe8fb19SBen Gras.Tn NS 3292fe8fb19SBen Grasaddresses with 3302fe8fb19SBen Gras.Tn ARPA 3312fe8fb19SBen GrasInternet protocols. 3322fe8fb19SBen Gras.It Er 48 EADDRINUSE Em "Address already in use" . 3332fe8fb19SBen GrasOnly one usage of each address is normally permitted. 3342fe8fb19SBen Gras.It Er 49 EADDRNOTAVAIL Em "Cannot assign requested address" . 3352fe8fb19SBen GrasNormally results from an attempt to create a socket with an 3362fe8fb19SBen Grasaddress not on this machine. 3372fe8fb19SBen Gras.It Er 50 ENETDOWN Em "Network is down" . 3382fe8fb19SBen GrasA socket operation encountered a dead network. 3392fe8fb19SBen Gras.It Er 51 ENETUNREACH Em "Network is unreachable" . 3402fe8fb19SBen GrasA socket operation was attempted to an unreachable network. 3412fe8fb19SBen Gras.It Er 52 ENETRESET Em "Network dropped connection on reset" . 3422fe8fb19SBen GrasThe host you were connected to crashed and rebooted. 3432fe8fb19SBen Gras.It Er 53 ECONNABORTED Em "Software caused connection abort" . 3442fe8fb19SBen GrasA connection abort was caused internal to your host machine. 3452fe8fb19SBen Gras.It Er 54 ECONNRESET Em "Connection reset by peer" . 3462fe8fb19SBen GrasA connection was forcibly closed by a peer. 3472fe8fb19SBen GrasThis normally results from a loss of the connection on the remote 3482fe8fb19SBen Grassocket due to a timeout or a reboot. 3492fe8fb19SBen Gras.It Er 55 ENOBUFS Em "\&No buffer space available" . 3502fe8fb19SBen GrasAn operation on a socket or pipe was not performed because 3512fe8fb19SBen Grasthe system lacked sufficient buffer space or because a queue was full. 3522fe8fb19SBen Gras.It Er 56 EISCONN Em "Socket is already connected" . 3532fe8fb19SBen GrasA 3542fe8fb19SBen Gras.Xr connect 2 3552fe8fb19SBen Grasrequest was made on an already connected socket; or, 3562fe8fb19SBen Grasa 3572fe8fb19SBen Gras.Xr sendto 2 3582fe8fb19SBen Grasor 3592fe8fb19SBen Gras.Xr sendmsg 2 3602fe8fb19SBen Grasrequest on a connected socket specified a destination 3612fe8fb19SBen Graswhen already connected. 3622fe8fb19SBen Gras.It Er 57 ENOTCONN Em "Socket is not connected" . 3632fe8fb19SBen GrasAn request to send or receive data was disallowed because 3642fe8fb19SBen Grasthe socket was not connected and (when sending on a datagram socket) 3652fe8fb19SBen Grasno address was supplied. 3662fe8fb19SBen Gras.It Er 58 ESHUTDOWN Em "Cannot send after socket shutdown" . 3672fe8fb19SBen GrasA request to send data was disallowed because the socket 3682fe8fb19SBen Grashad already been shut down with a previous 3692fe8fb19SBen Gras.Xr shutdown 2 3702fe8fb19SBen Grascall. 3712fe8fb19SBen Gras.It Er 59 ETOOMANYREFS Em "Too many references: can't splice" . 3722fe8fb19SBen GrasThe resource is used up to capacity. 3732fe8fb19SBen Gras.It Er 60 ETIMEDOUT Em "Operation timed out" . 3742fe8fb19SBen GrasA 3752fe8fb19SBen Gras.Xr connect 2 3762fe8fb19SBen Grasor 3772fe8fb19SBen Gras.Xr send 2 3782fe8fb19SBen Grasrequest failed because the connected party did not 3792fe8fb19SBen Grasproperly respond after a period of time. 3802fe8fb19SBen Gras(The timeout period is dependent on the communication protocol). 3812fe8fb19SBen Gras.It Er 61 ECONNREFUSED Em "Connection refused" . 3822fe8fb19SBen GrasNo connection could be made because the target machine actively 3832fe8fb19SBen Grasrefused it. 3842fe8fb19SBen GrasThis usually results from trying to connect 3852fe8fb19SBen Grasto a service that is inactive on the foreign host. 3862fe8fb19SBen Gras.It Er 62 ELOOP Em "Too many levels of symbolic links" . 3872fe8fb19SBen GrasA path name lookup involved more than 32 3882fe8fb19SBen Gras.Pq Dv MAXSYMLINKS 3892fe8fb19SBen Grassymbolic links. 3902fe8fb19SBen Gras.It Er 63 ENAMETOOLONG Em "File name too long" . 3912fe8fb19SBen GrasA component of a path name exceeded 255 3922fe8fb19SBen Gras.Pq Dv MAXNAMELEN 3932fe8fb19SBen Grascharacters, or an entire 3942fe8fb19SBen Graspath name exceeded 1023 3952fe8fb19SBen Gras.Pq Dv MAXPATHLEN Ns \-1 3962fe8fb19SBen Grascharacters. 3972fe8fb19SBen Gras.It Er 64 EHOSTDOWN Em "Host is down" . 3982fe8fb19SBen GrasA socket operation failed because the destination host was down. 3992fe8fb19SBen Gras.It Er 65 EHOSTUNREACH Em "No route to host" . 4002fe8fb19SBen GrasA socket operation was attempted to an unreachable host. 4012fe8fb19SBen Gras.It Er 66 ENOTEMPTY Em "Directory not empty" . 4022fe8fb19SBen GrasA directory with entries other than 4032fe8fb19SBen Gras.Ql \&. 4042fe8fb19SBen Grasand 4052fe8fb19SBen Gras.Ql \&.. 4062fe8fb19SBen Graswas supplied to a remove directory or rename call. 4072fe8fb19SBen Gras.It Er 67 EPROCLIM Em "Too many processes" . 4082fe8fb19SBen Gras.It Er 68 EUSERS Em "Too many users" . 4092fe8fb19SBen GrasThe quota system ran out of table entries. 4102fe8fb19SBen Gras.It Er 69 EDQUOT Em "Disc quota exceeded" . 4112fe8fb19SBen GrasA 4122fe8fb19SBen Gras.Xr write 2 4132fe8fb19SBen Grasto an ordinary file, the creation of a 4142fe8fb19SBen Grasdirectory or symbolic link, or the creation of a directory 4152fe8fb19SBen Grasentry failed because the user's quota of disk blocks was 4162fe8fb19SBen Grasexhausted, or the allocation of an inode for a newly 4172fe8fb19SBen Grascreated file failed because the user's quota of inodes 4182fe8fb19SBen Graswas exhausted. 4192fe8fb19SBen Gras.It Er 70 ESTALE Em "Stale NFS file handle" . 4202fe8fb19SBen GrasAn attempt was made to access an open file (on an 4212fe8fb19SBen Gras.Tn NFS 4222fe8fb19SBen Grasfilesystem) 4232fe8fb19SBen Graswhich is now unavailable as referenced by the file descriptor. 4242fe8fb19SBen GrasThis may indicate the file was deleted on the 4252fe8fb19SBen Gras.Tn NFS 4262fe8fb19SBen Grasserver or some other catastrophic event occurred. 4272fe8fb19SBen Gras.It Er 71 EREMOTE Em "Too many levels of remote in path" . 4282fe8fb19SBen Gras.Tn NFS 4292fe8fb19SBen Grasversion 3 RPC return code 71. 4302fe8fb19SBen Gras.It Er 72 EBADRPC Em "RPC struct is bad" . 4312fe8fb19SBen GrasExchange of 4322fe8fb19SBen Gras.Tn RPC 4332fe8fb19SBen Grasinformation was unsuccessful. 4342fe8fb19SBen Gras.It Er 73 ERPCMISMATCH Em "RPC version wrong" . 4352fe8fb19SBen GrasThe version of 4362fe8fb19SBen Gras.Tn RPC 4372fe8fb19SBen Grason the remote peer is not compatible with 4382fe8fb19SBen Grasthe local version. 4392fe8fb19SBen Gras.It Er 74 EPROGUNAVAIL Em "RPC prog. not avail" . 4402fe8fb19SBen GrasThe requested program is not registered on the remote host. 4412fe8fb19SBen Gras.It Er 75 EPROGMISMATCH Em "Program version wrong" . 4422fe8fb19SBen GrasThe requested version of the program is not available 4432fe8fb19SBen Grason the remote host 4442fe8fb19SBen Gras.Pq Tn RPC . 4452fe8fb19SBen Gras.It Er 76 EPROCUNAVAIL Em "Bad procedure for program" . 4462fe8fb19SBen GrasAn 4472fe8fb19SBen Gras.Tn RPC 4482fe8fb19SBen Grascall was attempted for a procedure which doesn't exist 4492fe8fb19SBen Grasin the remote program. 4502fe8fb19SBen Gras.It Er 77 ENOLCK Em "No locks available" . 4512fe8fb19SBen GrasA system-imposed limit on the number of simultaneous file 4522fe8fb19SBen Graslocks was reached. 4532fe8fb19SBen Gras.It Er 78 ENOSYS Em "Function not implemented" . 4542fe8fb19SBen GrasAttempted a system call that is not available on this 4552fe8fb19SBen Grassystem. 4562fe8fb19SBen Gras.It Er 79 EFTYPE Em "Inappropriate file type or format" . 4572fe8fb19SBen GrasAttempted a file operation on a file of a type for which it was invalid. 4582fe8fb19SBen Gras.It Er 80 EAUTH Em "Authentication error" . 4592fe8fb19SBen GrasAttempted to use an invalid authentication ticket to mount an 4602fe8fb19SBen Gras.Tn NFS 4612fe8fb19SBen Grasfilesystem. 4622fe8fb19SBen Gras.It Er 81 ENEEDAUTH Em "Need authenticator" . 4632fe8fb19SBen GrasAn authentication ticket must be obtained before the given 4642fe8fb19SBen Gras.Tn NFS 4652fe8fb19SBen Grasfilesystem may be mounted. 4662fe8fb19SBen Gras.It Er 82 EIDRM Em "Identifier removed" . 4672fe8fb19SBen GrasAn IPC identifier was removed while the current process was waiting on it. 4682fe8fb19SBen Gras.It Er 83 ENOMSG Em "No message of the desired type" . 4692fe8fb19SBen GrasAn IPC message queue does not contain a message of the desired type, 4702fe8fb19SBen Grasor a message catalog does not contain the requested message. 4712fe8fb19SBen Gras.It Er 84 EOVERFLOW Em "Value too large to be stored in data type" . 4722fe8fb19SBen GrasA numerical result of the function was too large to be stored in the 4732fe8fb19SBen Grascaller-provided space. 4742fe8fb19SBen Gras.It Er 85 EILSEQ Em "Illegal byte sequence" . 4752fe8fb19SBen GrasA wide character/multibyte character encoding error occurred. 4762fe8fb19SBen Gras.It Er 86 ENOTSUP Em "Not supported" . 4772fe8fb19SBen GrasAn attempt was made to set or change a parameter to an unsupported 4782fe8fb19SBen Grasvalue. 4792fe8fb19SBen Gras.It Er 87 ECANCELED Em "Operation canceled" . 4802fe8fb19SBen GrasThe requested operation was canceled. 4812fe8fb19SBen Gras.It Er 88 EBADMSG Em "Bad or corrupt message" . 4822fe8fb19SBen GrasA message in the specified message catalog did not satisfy implementation 4832fe8fb19SBen Grasdefined criteria, or a STREAMS operation encountered an invalid message or 4842fe8fb19SBen Grasa file descriptor at the STREAM head. 4852fe8fb19SBen Gras.It Er 89 ENODATA Em "No message available" . 4862fe8fb19SBen GrasNo message is available on the STREAM head read queue 4872fe8fb19SBen Gras.It Er 90 ENOSR Em "No STREAM resources" . 4882fe8fb19SBen GrasBuffers could not be allocated due to insufficient STREAMs memory resources. 4892fe8fb19SBen Gras.It Er 91 ENOSTR Em "Not a STREAM" . 4902fe8fb19SBen GrasA STREAM is not associated with the specified file descriptor. 4912fe8fb19SBen Gras.It Er 92 ETIME Em "STREAM ioctl timeout" . 4922fe8fb19SBen GrasThe timer set for a STREAMS 4932fe8fb19SBen Gras.Xr ioctl 2 4942fe8fb19SBen Grasoperation has expired. 4952fe8fb19SBen Gras.It Er 93 ENOATTR Em "Attribute not found" . 4962fe8fb19SBen GrasThe specified extended attribute does not exist. 4972fe8fb19SBen Gras.It Er 94 EMULTIHOP Em "Multihop attempted" . 4982fe8fb19SBen GrasComponents of path require hopping to multiple remote machines and the 4992fe8fb19SBen Grasfile system does not allow it. 5002fe8fb19SBen GrasIt occurs when users try to access remote resources which are not directly 5012fe8fb19SBen Grasaccessible. 5022fe8fb19SBen Gras.It Er 95 ENOLINK Em "Link has been severed" . 5032fe8fb19SBen GrasOccurs when the link (virtual circuit) connecting to a remote machine is gone. 5042fe8fb19SBen Gras.It Er 96 EPROTO Em "Protocol error" . 5052fe8fb19SBen GrasSome protocol error occurred. 5062fe8fb19SBen GrasThis error is device-specific, but is generally not related to a hardware 5072fe8fb19SBen Grasfailure. 5082fe8fb19SBen Gras.El 5092fe8fb19SBen Gras.Sh DEFINITIONS 5102fe8fb19SBen Gras.Bl -tag -width Ds 5112fe8fb19SBen Gras.It Process ID 5122fe8fb19SBen GrasEach active process in the system is uniquely identified by a non-negative 5132fe8fb19SBen Grasinteger called a process ID. 5142fe8fb19SBen GrasThe range of this ID is from 0 to 30000. 5152fe8fb19SBen Gras.It Parent process ID 5162fe8fb19SBen GrasA new process is created by a currently active process; (see 5172fe8fb19SBen Gras.Xr fork 2 ) . 5182fe8fb19SBen GrasThe parent process ID of a process is initially the process ID of its creator. 5192fe8fb19SBen GrasIf the creating process exits, 5202fe8fb19SBen Grasthe parent process ID of each child is set to the ID of a system process, 5212fe8fb19SBen Gras.Xr init 8 . 5222fe8fb19SBen Gras.It Process Group 5232fe8fb19SBen GrasEach active process is a member of a process group that is identified by 5242fe8fb19SBen Grasa non-negative integer called the process group ID. 5252fe8fb19SBen GrasThis is the process ID of the group leader. 5262fe8fb19SBen GrasThis grouping permits the signaling of related processes (see 5272fe8fb19SBen Gras.Xr termios 4 ) 5282fe8fb19SBen Grasand the job control mechanisms of 5292fe8fb19SBen Gras.Xr csh 1 . 5302fe8fb19SBen Gras.It Session 5312fe8fb19SBen GrasA session is a set of one or more process groups. 5322fe8fb19SBen GrasA session is created by a successful call to 5332fe8fb19SBen Gras.Xr setsid 2 , 5342fe8fb19SBen Graswhich causes the caller to become the only member of the only process 5352fe8fb19SBen Grasgroup in the new session. 5362fe8fb19SBen Gras.It Session leader 5372fe8fb19SBen GrasA process that has created a new session by a successful call to 5382fe8fb19SBen Gras.Xr setsid 2 , 5392fe8fb19SBen Grasis known as a session leader. 5402fe8fb19SBen GrasOnly a session leader may acquire a terminal as its controlling terminal (see 5412fe8fb19SBen Gras.Xr termios 4 ) . 5422fe8fb19SBen Gras.It Controlling process 5432fe8fb19SBen GrasA session leader with a controlling terminal is a controlling process. 5442fe8fb19SBen Gras.It Controlling terminal 5452fe8fb19SBen GrasA terminal that is associated with a session is known as the controlling 5462fe8fb19SBen Grasterminal for that session and its members. 5472fe8fb19SBen Gras.It "Terminal Process Group ID" 5482fe8fb19SBen GrasA terminal may be acquired by a session leader as its controlling terminal. 5492fe8fb19SBen GrasOnce a terminal is associated with a session, any of the process groups 5502fe8fb19SBen Graswithin the session may be placed into the foreground by setting 5512fe8fb19SBen Grasthe terminal process group ID to the ID of the process group. 5522fe8fb19SBen GrasThis facility is used 5532fe8fb19SBen Grasto arbitrate between multiple jobs contending for the same terminal. 5542fe8fb19SBen Gras(See 5552fe8fb19SBen Gras.Xr csh 1 5562fe8fb19SBen Grasand 5572fe8fb19SBen Gras.Xr tty 4 5582fe8fb19SBen Grasfor more information on job control.) 5592fe8fb19SBen Gras.It "Orphaned Process Group" 5602fe8fb19SBen GrasA process group is considered to be 5612fe8fb19SBen Gras.Em orphaned 5622fe8fb19SBen Grasif it is not under the control of a job control shell. 5632fe8fb19SBen GrasMore precisely, a process group is orphaned 5642fe8fb19SBen Graswhen none of its members has a parent process that is in the same session 5652fe8fb19SBen Grasas the group, 5662fe8fb19SBen Grasbut is in a different process group. 5672fe8fb19SBen GrasNote that when a process exits, the parent process for its children 5682fe8fb19SBen Grasis changed to be 5692fe8fb19SBen Gras.Xr init 8 , 5702fe8fb19SBen Graswhich is in a separate session. 5712fe8fb19SBen GrasNot all members of an orphaned process group are necessarily orphaned 5722fe8fb19SBen Grasprocesses (those whose creating process has exited). 5732fe8fb19SBen GrasThe process group of a session leader is orphaned by definition. 5742fe8fb19SBen Gras.It "Real User ID and Real Group ID" 5752fe8fb19SBen GrasEach user on the system is identified by a positive integer 5762fe8fb19SBen Grastermed the real user ID. 5772fe8fb19SBen Gras.Pp 5782fe8fb19SBen GrasEach user is also a member of one or more groups. 5792fe8fb19SBen GrasOne of these groups is distinguished from others and 5802fe8fb19SBen Grasused in implementing accounting facilities. 5812fe8fb19SBen GrasThe positive integer corresponding to this distinguished group is 5822fe8fb19SBen Grastermed the real group ID. 5832fe8fb19SBen Gras.Pp 5842fe8fb19SBen GrasAll processes have a real user ID and real group ID. 5852fe8fb19SBen GrasThese are initialized from the equivalent attributes 5862fe8fb19SBen Grasof the process that created it. 5872fe8fb19SBen Gras.It "Effective User Id, Effective Group Id, and Group Access List" 5882fe8fb19SBen GrasAccess to system resources is governed by two values: 5892fe8fb19SBen Grasthe effective user ID, and the group access list. 5902fe8fb19SBen GrasThe first member of the group access list is also known as the 5912fe8fb19SBen Graseffective group ID. 5922fe8fb19SBen Gras(In POSIX.1, the group access list is known as the set of supplementary 5932fe8fb19SBen Grasgroup IDs, and it is unspecified whether the effective group ID is 5942fe8fb19SBen Grasa member of the list.) 5952fe8fb19SBen Gras.Pp 5962fe8fb19SBen GrasThe effective user ID and effective group ID are initially the 5972fe8fb19SBen Grasprocess's real user ID and real group ID respectively. 5982fe8fb19SBen GrasEither may be modified through execution of a set-user-ID or 5992fe8fb19SBen Grasset-group-ID file (possibly by one of its ancestors) (see 6002fe8fb19SBen Gras.Xr execve 2 ) . 6012fe8fb19SBen GrasBy convention, the effective group ID (the first member of the group access 6022fe8fb19SBen Graslist) is duplicated, so that the execution of a set-group-ID program 6032fe8fb19SBen Grasdoes not result in the loss of the original (real) group ID. 6042fe8fb19SBen Gras.Pp 6052fe8fb19SBen GrasThe group access list is a set of group IDs 6062fe8fb19SBen Grasused only in determining resource accessibility. 6072fe8fb19SBen GrasAccess checks are performed as described below in 6082fe8fb19SBen Gras.Qq File Access Permissions . 6092fe8fb19SBen Gras.It "Saved Set User ID and Saved Set Group ID" 6102fe8fb19SBen GrasWhen a process executes a new file, the effective user ID is set 6112fe8fb19SBen Grasto the owner of the file if the file is set-user-ID, and the effective 6122fe8fb19SBen Grasgroup ID (first element of the group access list) is set to the group 6132fe8fb19SBen Grasof the file if the file is set-group-ID. 6142fe8fb19SBen GrasThe effective user ID of the process is then recorded as the saved set-user-ID, 6152fe8fb19SBen Grasand the effective group ID of the process is recorded as the saved set-group-ID. 6162fe8fb19SBen GrasThese values may be used to regain those values as the effective user 6172fe8fb19SBen Grasor group ID after reverting to the real ID (see 6182fe8fb19SBen Gras.Xr setuid 2 ) . 6192fe8fb19SBen Gras(In POSIX.1, the saved set-user-ID and saved set-group-ID are optional, 6202fe8fb19SBen Grasand are used in setuid and setgid, but this does not work as desired 6212fe8fb19SBen Grasfor the super-user.) 6222fe8fb19SBen Gras.It Super-user 6232fe8fb19SBen GrasA process is recognized as a 6242fe8fb19SBen Gras.Em super-user 6252fe8fb19SBen Grasprocess and is granted special privileges if its effective user ID is 0. 6262fe8fb19SBen Gras.It Special Processes 6272fe8fb19SBen GrasThe processes with process IDs of 0 and 1 are special. 6282fe8fb19SBen GrasProcess 0 is the scheduler. 6292fe8fb19SBen GrasProcess 1 is the initialization process 6302fe8fb19SBen Gras.Xr init 8 , 6312fe8fb19SBen Grasand is the ancestor (parent) of every other process in the system. 6322fe8fb19SBen GrasIt is used to control the process structure. 6332fe8fb19SBen GrasThe kernel will allocate other kernel threads to handle certain 6342fe8fb19SBen Grasperiodic tasks or device related tasks, such as: 6352fe8fb19SBen Gras.Bl -tag -width pagedaemon 6362fe8fb19SBen Gras.It Sy acctwatch 6372fe8fb19SBen GrasSystem accounting disk watcher, see 6382fe8fb19SBen Gras.Xr acct 2 , 6392fe8fb19SBen Gras.Xr acct 5 . 6402fe8fb19SBen Gras.It Sy aiodoned 6412fe8fb19SBen GrasAsynchronous I/O done handler, see 6422fe8fb19SBen Gras.Xr uvm 9 . 6432fe8fb19SBen Gras.It Sy atabusX 6442fe8fb19SBen GrasATA bus handler, see 6452fe8fb19SBen Gras.Xr ata 4 . 6462fe8fb19SBen Gras.It Sy cardslotX 6472fe8fb19SBen GrasCardBus slot watcher thread, see 6482fe8fb19SBen Gras.Xr cardslot 4 . 6492fe8fb19SBen Gras.It Sy cryptoret 6502fe8fb19SBen GrasThe software crypto daemon. 6512fe8fb19SBen Gras.It Sy fssbsX 6522fe8fb19SBen GrasFile system snapshot thread, see 6532fe8fb19SBen Gras.Xr fss 4 . 6542fe8fb19SBen Gras.It Sy ioflush 6552fe8fb19SBen GrasThe in-kernel periodic flush the buffer cache to disk task, 6562fe8fb19SBen Graswhich replaces the old 6572fe8fb19SBen Gras.Sy update 6582fe8fb19SBen Grasprogram. 6592fe8fb19SBen Gras.It Sy nfsio , nfskqpoll 6602fe8fb19SBen GrasNFS handing daemons. 6612fe8fb19SBen Gras.It Sy lfs_writer 6622fe8fb19SBen GrasLog filesystem writer. 6632fe8fb19SBen Gras.It Sy pagedaemon 6642fe8fb19SBen GrasThe page daemon. 6652fe8fb19SBen Gras.It Sy raidX , raidioX , raid_parity , raid_recon , raid_reconip , raid_copyback 6662fe8fb19SBen GrasRaid framework related threads, see 6672fe8fb19SBen Gras.Xr raid 4 . 6682fe8fb19SBen Gras.It Sy scsibusX 6692fe8fb19SBen GrasSCSI bus handler, see 6702fe8fb19SBen Gras.Xr scsi 4 . 6712fe8fb19SBen Gras.It Sy smbiodX , smbkq 6722fe8fb19SBen GrasSMBFS handling daemon, see 6732fe8fb19SBen Gras.Xr netsmb 4 . 6742fe8fb19SBen Gras.It Sy swdmover 6752fe8fb19SBen GrasThe software data mover I/O thread, see 6762fe8fb19SBen Gras.Xr dmoverio 4 . 6772fe8fb19SBen Gras.It Sy sysmon 6782fe8fb19SBen GrasThe systems monitoring framework daemon. 6792fe8fb19SBen Gras.It Sy usbX , usbtask 6802fe8fb19SBen GrasUSB bus handler, see 6812fe8fb19SBen Gras.Xr usb 4 . 6822fe8fb19SBen Gras.El 6832fe8fb19SBen Gras.Pp 6842fe8fb19SBen GrasThere are more machine-dependent kernel threads allocated by 6852fe8fb19SBen Grasdifferent drivers. 6862fe8fb19SBen GrasSee the specific driver manual pages for more information. 6872fe8fb19SBen Gras.It Descriptor 6882fe8fb19SBen GrasAn integer assigned by the system when a file is referenced 6892fe8fb19SBen Grasby 6902fe8fb19SBen Gras.Xr open 2 6912fe8fb19SBen Grasor 6922fe8fb19SBen Gras.Xr dup 2 , 6932fe8fb19SBen Grasor when a socket is created by 6942fe8fb19SBen Gras.Xr pipe 2 , 6952fe8fb19SBen Gras.Xr socket 2 , 6962fe8fb19SBen Grasor 6972fe8fb19SBen Gras.Xr socketpair 2 , 6982fe8fb19SBen Graswhich uniquely identifies an access path to that file or socket from 6992fe8fb19SBen Grasa given process or any of its children. 7002fe8fb19SBen Gras.It File Name 7012fe8fb19SBen GrasNames consisting of up to 255 7022fe8fb19SBen Gras.Pq Dv MAXNAMELEN 7032fe8fb19SBen Grascharacters may be used to name 7042fe8fb19SBen Grasan ordinary file, special file, or directory. 7052fe8fb19SBen Gras.Pp 7062fe8fb19SBen GrasThese characters may be selected from the set of all 7072fe8fb19SBen Gras.Tn ASCII 7082fe8fb19SBen Grascharacter 7092fe8fb19SBen Grasexcluding 0 (NUL) and the 7102fe8fb19SBen Gras.Tn ASCII 7112fe8fb19SBen Grascode for 7122fe8fb19SBen Gras.Ql \&/ 7132fe8fb19SBen Gras(slash). 7142fe8fb19SBen Gras(The parity bit, bit 7, must be 0). 7152fe8fb19SBen Gras.Pp 7162fe8fb19SBen GrasNote that it is generally unwise to use 7172fe8fb19SBen Gras.Ql \&* , 7182fe8fb19SBen Gras.Ql \&? , 7192fe8fb19SBen Gras.Ql \&[ 7202fe8fb19SBen Grasor 7212fe8fb19SBen Gras.Ql \&] 7222fe8fb19SBen Grasas part of 7232fe8fb19SBen Grasfile names because of the special meaning attached to these characters 7242fe8fb19SBen Grasby the shell. 7252fe8fb19SBen Gras.It Pathname 7262fe8fb19SBen GrasA path name is a 7272fe8fb19SBen Gras.Tn NUL Ns -terminated 7282fe8fb19SBen Grascharacter string starting with an 7292fe8fb19SBen Grasoptional slash 7302fe8fb19SBen Gras.Ql \&/ , 7312fe8fb19SBen Grasfollowed by zero or more directory names separated 7322fe8fb19SBen Grasby slashes, optionally followed by a file name. 7332fe8fb19SBen GrasThe total length of a path name must be less than 1024 7342fe8fb19SBen Gras.Pq Dv MAXPATHLEN 7352fe8fb19SBen Grascharacters. 7362fe8fb19SBen Gras.Pp 7372fe8fb19SBen GrasIf a path name begins with a slash, the path search begins at the 7382fe8fb19SBen Gras.Em root 7392fe8fb19SBen Grasdirectory. 7402fe8fb19SBen GrasOtherwise, the search begins from the current working directory. 7412fe8fb19SBen GrasA slash by itself names the root directory. 7422fe8fb19SBen GrasAn empty string is not a valid pathname. 7432fe8fb19SBen Gras.It Directory 7442fe8fb19SBen GrasA directory is a special type of file that contains entries 7452fe8fb19SBen Grasthat are references to other files. 7462fe8fb19SBen GrasDirectory entries are called links. 7472fe8fb19SBen GrasBy convention, a directory contains at least two links, 7482fe8fb19SBen Gras.Ql \&. 7492fe8fb19SBen Grasand 7502fe8fb19SBen Gras.Ql \&.. , 7512fe8fb19SBen Grasreferred to as 7522fe8fb19SBen Gras.Em dot 7532fe8fb19SBen Grasand 7542fe8fb19SBen Gras.Em dot-dot 7552fe8fb19SBen Grasrespectively. 7562fe8fb19SBen GrasDot refers to the directory itself and dot-dot refers to its parent directory. 7572fe8fb19SBen Gras.It "Root Directory and Current Working Directory" 7582fe8fb19SBen GrasEach process has associated with it a concept of a root directory 7592fe8fb19SBen Grasand a current working directory for the purpose of resolving path 7602fe8fb19SBen Grasname searches. 7612fe8fb19SBen GrasA process's root directory need not be the root 7622fe8fb19SBen Grasdirectory of the root file system. 7632fe8fb19SBen Gras.It File Access Permissions 7642fe8fb19SBen GrasEvery file in the file system has a set of access permissions. 7652fe8fb19SBen GrasThese permissions are used in determining whether a process 7662fe8fb19SBen Grasmay perform a requested operation on the file (such as opening 7672fe8fb19SBen Grasa file for writing). 7682fe8fb19SBen GrasAccess permissions are established at the time a file is created. 7692fe8fb19SBen GrasThey may be changed at some later time through the 7702fe8fb19SBen Gras.Xr chmod 2 7712fe8fb19SBen Grascall. 7722fe8fb19SBen Gras.Pp 7732fe8fb19SBen GrasFile access is broken down according to whether a file may be: read, 7742fe8fb19SBen Graswritten, or executed. 7752fe8fb19SBen GrasDirectory files use the execute permission to control if the 7762fe8fb19SBen Grasdirectory may be searched. 7772fe8fb19SBen Gras.Pp 7782fe8fb19SBen GrasFile access permissions are interpreted by the system as 7792fe8fb19SBen Grasthey apply to three different classes of users: the owner 7802fe8fb19SBen Grasof the file, those users in the file's group, anyone else. 7812fe8fb19SBen GrasEvery file has an independent set of access permissions for 7822fe8fb19SBen Graseach of these classes. 7832fe8fb19SBen GrasWhen an access check is made, the system decides if permission should be 7842fe8fb19SBen Grasgranted by checking the access information applicable to the caller. 7852fe8fb19SBen Gras.Pp 7862fe8fb19SBen GrasRead, write, and execute/search permissions on 7872fe8fb19SBen Grasa file are granted to a process if: 7882fe8fb19SBen Gras.Pp 7892fe8fb19SBen GrasThe process's effective user ID is that of the super-user. 7902fe8fb19SBen Gras(Note: even the super-user cannot execute a non-executable file). 7912fe8fb19SBen Gras.Pp 7922fe8fb19SBen GrasThe process's effective user ID matches the user ID of the owner 7932fe8fb19SBen Grasof the file and the owner permissions allow the access. 7942fe8fb19SBen Gras.Pp 7952fe8fb19SBen GrasThe process's effective user ID does not match the user ID of the 7962fe8fb19SBen Grasowner of the file, and either the process's effective 7972fe8fb19SBen Grasgroup ID matches the group ID 7982fe8fb19SBen Grasof the file, or the group ID of the file is in 7992fe8fb19SBen Grasthe process's group access list, 8002fe8fb19SBen Grasand the group permissions allow the access. 8012fe8fb19SBen Gras.Pp 8022fe8fb19SBen GrasNeither the effective user ID nor effective group ID 8032fe8fb19SBen Grasand group access list of the process 8042fe8fb19SBen Grasmatch the corresponding user ID and group ID of the file, 8052fe8fb19SBen Grasbut the permissions for ``other users'' allow access. 8062fe8fb19SBen Gras.Pp 8072fe8fb19SBen GrasOtherwise, permission is denied. 8082fe8fb19SBen Gras.It Sockets and Address Families 8092fe8fb19SBen GrasA socket is an endpoint for communication between processes. 8102fe8fb19SBen GrasEach socket has queues for sending and receiving data. 8112fe8fb19SBen Gras.Pp 8122fe8fb19SBen GrasSockets are typed according to their communications properties. 8132fe8fb19SBen GrasThese properties include whether messages sent and received 8142fe8fb19SBen Grasat a socket require the name of the partner, whether communication 8152fe8fb19SBen Grasis reliable, the format used in naming message recipients, etc. 8162fe8fb19SBen Gras.Pp 8172fe8fb19SBen GrasEach instance of the system supports some 8182fe8fb19SBen Grascollection of socket types; consult 8192fe8fb19SBen Gras.Xr socket 2 8202fe8fb19SBen Grasfor more information about the types available and 8212fe8fb19SBen Grastheir properties. 8222fe8fb19SBen Gras.Pp 8232fe8fb19SBen GrasEach instance of the system supports some number of sets of 8242fe8fb19SBen Grascommunications protocols. 8252fe8fb19SBen GrasEach protocol set supports addresses of a certain format. 8262fe8fb19SBen GrasAn Address Family is the set of addresses for a specific group of protocols. 8272fe8fb19SBen GrasEach socket has an address 8282fe8fb19SBen Graschosen from the address family in which the socket was created. 8292fe8fb19SBen Gras.El 8302fe8fb19SBen Gras.Sh SEE ALSO 8312fe8fb19SBen Gras.Xr intro 3 , 8322fe8fb19SBen Gras.Xr perror 3 8332fe8fb19SBen Gras.Sh HISTORY 8342fe8fb19SBen GrasAn 8352fe8fb19SBen Gras.Nm intro 8362fe8fb19SBen Grasmanual page appeared in 8372fe8fb19SBen Gras.At v6 . 838