Thu Jul 23 13:37:34 2009 UTC ()
Bump date for previous.


(wiz)
diff -r1.53 -r1.54 src/lib/libc/sys/intro.2

cvs diff -r1.53 -r1.54 src/lib/libc/sys/intro.2 (switch to unified diff)

--- src/lib/libc/sys/intro.2 2009/07/23 02:31:56 1.53
+++ src/lib/libc/sys/intro.2 2009/07/23 13:37:34 1.54
@@ -1,832 +1,832 @@ @@ -1,832 +1,832 @@
1.\" $NetBSD: intro.2,v 1.53 2009/07/23 02:31:56 dholland Exp $ 1.\" $NetBSD: intro.2,v 1.54 2009/07/23 13:37:34 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1980, 1983, 1986, 1991, 1993 3.\" Copyright (c) 1980, 1983, 1986, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
15.\" may be used to endorse or promote products derived from this software 15.\" may be used to endorse or promote products derived from this software
16.\" without specific prior written permission. 16.\" without specific prior written permission.
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" @(#)intro.2 8.5 (Berkeley) 2/27/95 30.\" @(#)intro.2 8.5 (Berkeley) 2/27/95
31.\" 31.\"
32.Dd June 2, 2009 32.Dd July 23, 2009
33.Dt INTRO 2 33.Dt INTRO 2
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm intro , 36.Nm intro ,
37.Nm errno 37.Nm errno
38.Nd introduction to system calls and error numbers 38.Nd introduction to system calls and error numbers
39.Sh SYNOPSIS 39.Sh SYNOPSIS
40.In errno.h 40.In errno.h
41.Sh DESCRIPTION 41.Sh DESCRIPTION
42This section provides an overview of the system calls, 42This section provides an overview of the system calls,
43their error returns, and other common definitions and concepts. 43their error returns, and other common definitions and concepts.
44.\".Pp 44.\".Pp
45.\".Sy System call restart 45.\".Sy System call restart
46.\".Pp 46.\".Pp
47.\"<more later...> 47.\"<more later...>
48.Sh DIAGNOSTICS 48.Sh DIAGNOSTICS
49Nearly all of the system calls provide an error number in the external 49Nearly all of the system calls provide an error number in the external
50variable 50variable
51.Va errno . 51.Va errno .
52.Va errno 52.Va errno
53is implemented as a macro which expands to a modifiable lvalue of type 53is implemented as a macro which expands to a modifiable lvalue of type
54.Fa int . 54.Fa int .
55.Pp 55.Pp
56When a system call detects an error, 56When a system call detects an error,
57it returns an integer value 57it returns an integer value
58indicating failure (usually \-1) 58indicating failure (usually \-1)
59and sets the variable 59and sets the variable
60.Va errno 60.Va errno
61accordingly. 61accordingly.
62(This allows interpretation of the failure on receiving 62(This allows interpretation of the failure on receiving
63a \-1 and to take action accordingly.) 63a \-1 and to take action accordingly.)
64Successful calls never set 64Successful calls never set
65.Va errno ; 65.Va errno ;
66once set, it remains until another error occurs. 66once set, it remains until another error occurs.
67It should only be examined after an error has been reported, because 67It should only be examined after an error has been reported, because
68otherwise a leftover value from some previous error may be found 68otherwise a leftover value from some previous error may be found
69instead. 69instead.
70.Po 70.Po
71Many library functions that are not system calls also set 71Many library functions that are not system calls also set
72.Va errno 72.Va errno
73on return, in the same fashion. 73on return, in the same fashion.
74In these cases a nonzero value may be left in 74In these cases a nonzero value may be left in
75.Va errno 75.Va errno
76even upon successful return if some internal action failed. 76even upon successful return if some internal action failed.
77.Pc 77.Pc
78.Pp 78.Pp
79The manual page for each system call will list some of the common 79The manual page for each system call will list some of the common
80errno codes that system call can return, but that should not be 80errno codes that system call can return, but that should not be
81considered an exhaustive list, i.e. 81considered an exhaustive list, i.e.
82a properly written program should be able to gracefully recover from 82a properly written program should be able to gracefully recover from
83any error that a system call might return. 83any error that a system call might return.
84Documenting all the error codes that a system call can return in 84Documenting all the error codes that a system call can return in
85a more specification-like manner would take more resources than 85a more specification-like manner would take more resources than
86this project has available. 86this project has available.
87.Pp 87.Pp
88Note also that a number of system calls overload the meanings of these 88Note also that a number of system calls overload the meanings of these
89error numbers, and that in these cases the meanings must be 89error numbers, and that in these cases the meanings must be
90interpreted according to the type and circumstances of the call. 90interpreted according to the type and circumstances of the call.
91.Pp 91.Pp
92The following is a complete list of the errors and their 92The following is a complete list of the errors and their
93names as given in 93names as given in
94.Aq Pa errno.h . 94.Aq Pa errno.h .
95.Bl -hang -width Ds 95.Bl -hang -width Ds
96.It Er 0 Em "Error 0" . 96.It Er 0 Em "Error 0" .
97Not used. 97Not used.
98.It Er 1 EPERM Em "Operation not permitted" . 98.It Er 1 EPERM Em "Operation not permitted" .
99An attempt was made to perform an operation limited to processes 99An attempt was made to perform an operation limited to processes
100with appropriate privileges or to the owner of a file or other 100with appropriate privileges or to the owner of a file or other
101resources. 101resources.
102.It Er 2 ENOENT Em "No such file or directory" . 102.It Er 2 ENOENT Em "No such file or directory" .
103A component of a specified pathname did not exist, or the 103A component of a specified pathname did not exist, or the
104pathname was an empty string. 104pathname was an empty string.
105.It Er 3 ESRCH Em "No such process" . 105.It Er 3 ESRCH Em "No such process" .
106No process could be found corresponding to that specified by the given 106No process could be found corresponding to that specified by the given
107process ID. 107process ID.
108.It Er 4 EINTR Em "Interrupted function call" . 108.It Er 4 EINTR Em "Interrupted function call" .
109An asynchronous signal (such as 109An asynchronous signal (such as
110.Dv SIGINT 110.Dv SIGINT
111or 111or
112.Dv SIGQUIT ) 112.Dv SIGQUIT )
113was caught by the process during the execution of an interruptible 113was caught by the process during the execution of an interruptible
114function. 114function.
115If the signal handler performs a normal return, the 115If the signal handler performs a normal return, the
116interrupted function call will seem to have returned the error condition. 116interrupted function call will seem to have returned the error condition.
117.It Er 5 EIO Em "Input/output error" . 117.It Er 5 EIO Em "Input/output error" .
118Some physical input or output error occurred. 118Some physical input or output error occurred.
119This error will not be reported until a subsequent operation on the same file 119This error will not be reported until a subsequent operation on the same file
120descriptor and may be lost (over written) by any subsequent errors. 120descriptor and may be lost (over written) by any subsequent errors.
121.It Er 6 ENXIO Em "Device not configured" . 121.It Er 6 ENXIO Em "Device not configured" .
122Input or output on a special file referred to a device that did not 122Input or output on a special file referred to a device that did not
123exist, or 123exist, or
124made a request beyond the limits of the device. 124made a request beyond the limits of the device.
125This error may also occur when, for example, 125This error may also occur when, for example,
126a tape drive is not online or no disk pack is 126a tape drive is not online or no disk pack is
127loaded on a drive. 127loaded on a drive.
128.It Er 7 E2BIG Em "Arg list too long" . 128.It Er 7 E2BIG Em "Arg list too long" .
129The number of bytes used for the argument and environment 129The number of bytes used for the argument and environment
130list of the new process exceeded the current limit of 130list of the new process exceeded the current limit of
131.if t 2\u\s-218\s+2\d 131.if t 2\u\s-218\s+2\d
132.if n 2**18 132.if n 2**18
133bytes 133bytes
134.Pf ( Dv ARG_MAX 134.Pf ( Dv ARG_MAX
135in 135in
136.Aq Pa sys/syslimits.h ) . 136.Aq Pa sys/syslimits.h ) .
137.It Er 8 ENOEXEC Em "Exec format error" . 137.It Er 8 ENOEXEC Em "Exec format error" .
138A request was made to execute a file 138A request was made to execute a file
139that, although it has the appropriate permissions, 139that, although it has the appropriate permissions,
140was not in the format required for an 140was not in the format required for an
141executable file. 141executable file.
142.It Er 9 EBADF Em "Bad file descriptor" . 142.It Er 9 EBADF Em "Bad file descriptor" .
143A file descriptor argument was out of range, referred to no open file, 143A file descriptor argument was out of range, referred to no open file,
144had been revoked by 144had been revoked by
145.Xr revoke 2 , 145.Xr revoke 2 ,
146or a 146or a
147.Xr read 2 147.Xr read 2
148(or 148(or
149.Xr write 2 ) 149.Xr write 2 )
150request was made to a file that was 150request was made to a file that was
151only open for writing (or reading). 151only open for writing (or reading).
152.It Er 10 ECHILD Em "\&No child processes" . 152.It Er 10 ECHILD Em "\&No child processes" .
153A 153A
154.Xr wait 2 154.Xr wait 2
155or 155or
156.Xr waitpid 2 156.Xr waitpid 2
157function was executed by a process that had no existing or unwaited-for 157function was executed by a process that had no existing or unwaited-for
158child processes. 158child processes.
159.It Er 11 EDEADLK Em "Resource deadlock avoided" . 159.It Er 11 EDEADLK Em "Resource deadlock avoided" .
160An attempt was made to lock a system resource that 160An attempt was made to lock a system resource that
161would have resulted in a deadlock situation. 161would have resulted in a deadlock situation.
162.It Er 12 ENOMEM Em "Cannot allocate memory" . 162.It Er 12 ENOMEM Em "Cannot allocate memory" .
163The new process image required more memory than was allowed by the hardware 163The new process image required more memory than was allowed by the hardware
164or by system-imposed memory management constraints. 164or by system-imposed memory management constraints.
165A lack of swap space is normally temporary; however, 165A lack of swap space is normally temporary; however,
166a lack of core is not. 166a lack of core is not.
167Soft limits may be increased to their corresponding hard limits. 167Soft limits may be increased to their corresponding hard limits.
168.It Er 13 EACCES Em "Permission denied" . 168.It Er 13 EACCES Em "Permission denied" .
169An attempt was made to access a file in a way forbidden 169An attempt was made to access a file in a way forbidden
170by its file access permissions. 170by its file access permissions.
171.It Er 14 EFAULT Em "Bad address" . 171.It Er 14 EFAULT Em "Bad address" .
172The system detected an invalid address in attempting to 172The system detected an invalid address in attempting to
173use an argument of a call. 173use an argument of a call.
174The reliable detection of this error cannot be guaranteed and when not detected 174The reliable detection of this error cannot be guaranteed and when not detected
175may result in the generation of a signal, indicating an address violation, 175may result in the generation of a signal, indicating an address violation,
176which is sent to the process. 176which is sent to the process.
177.It Er 15 ENOTBLK Em "Block device required" . 177.It Er 15 ENOTBLK Em "Block device required" .
178A block device operation was attempted on a non-block device or file. 178A block device operation was attempted on a non-block device or file.
179.It Er 16 EBUSY Em "Resource busy" . 179.It Er 16 EBUSY Em "Resource busy" .
180An attempt to use a system resource which was in use at the time 180An attempt to use a system resource which was in use at the time
181in a manner which would have conflicted with the request. 181in a manner which would have conflicted with the request.
182.It Er 17 EEXIST Em "File exists" . 182.It Er 17 EEXIST Em "File exists" .
183An existing file was mentioned in an inappropriate context, 183An existing file was mentioned in an inappropriate context,
184for instance, as the new link name in a 184for instance, as the new link name in a
185.Xr link 2 185.Xr link 2
186function. 186function.
187.It Er 18 EXDEV Em "Improper link" . 187.It Er 18 EXDEV Em "Improper link" .
188A hard link to a file on another file system 188A hard link to a file on another file system
189was attempted. 189was attempted.
190.It Er 19 ENODEV Em "Operation not supported by device" . 190.It Er 19 ENODEV Em "Operation not supported by device" .
191An attempt was made to apply an inappropriate 191An attempt was made to apply an inappropriate
192function to a device, 192function to a device,
193for example, 193for example,
194trying to read a write-only device such as a printer. 194trying to read a write-only device such as a printer.
195.It Er 20 ENOTDIR Em "Not a directory" . 195.It Er 20 ENOTDIR Em "Not a directory" .
196A component of the specified pathname existed, but it was 196A component of the specified pathname existed, but it was
197not a directory, when a directory was expected. 197not a directory, when a directory was expected.
198.It Er 21 EISDIR Em "Is a directory" . 198.It Er 21 EISDIR Em "Is a directory" .
199An attempt was made to open a directory with write mode specified. 199An attempt was made to open a directory with write mode specified.
200.It Er 22 EINVAL Em "Invalid argument" . 200.It Er 22 EINVAL Em "Invalid argument" .
201Some invalid argument was supplied. 201Some invalid argument was supplied.
202(For example, specifying an undefined signal to a 202(For example, specifying an undefined signal to a
203.Xr signal 3 203.Xr signal 3
204or 204or
205.Xr kill 2 205.Xr kill 2
206function). 206function).
207.It Er 23 ENFILE Em "Too many open files in system" . 207.It Er 23 ENFILE Em "Too many open files in system" .
208Maximum number of file descriptors allowable on the system 208Maximum number of file descriptors allowable on the system
209has been reached and a requests for an open cannot be satisfied 209has been reached and a requests for an open cannot be satisfied
210until at least one has been closed. 210until at least one has been closed.
211.It Er 24 EMFILE Em "Too many open files" . 211.It Er 24 EMFILE Em "Too many open files" .
212\*[Lt]As released, the limit on the number of 212\*[Lt]As released, the limit on the number of
213open files per process is 64.\*[Gt] 213open files per process is 64.\*[Gt]
214The 214The
215.Xr getrlimit 2 215.Xr getrlimit 2
216call with the 216call with the
217.Ar RLIMIT_NOFILE 217.Ar RLIMIT_NOFILE
218resource will obtain the current limit. 218resource will obtain the current limit.
219.It Er 25 ENOTTY Em "Inappropriate ioctl for device" . 219.It Er 25 ENOTTY Em "Inappropriate ioctl for device" .
220A control function (see 220A control function (see
221.Xr ioctl 2 ) 221.Xr ioctl 2 )
222was attempted for a file or 222was attempted for a file or
223special device for which the operation was inappropriate. 223special device for which the operation was inappropriate.
224.It Er 26 ETXTBSY Em "Text file busy" . 224.It Er 26 ETXTBSY Em "Text file busy" .
225The new process was a pure procedure (shared text) file 225The new process was a pure procedure (shared text) file
226which was open for writing by another process, or 226which was open for writing by another process, or
227while the pure procedure file was being executed an 227while the pure procedure file was being executed an
228.Xr open 2 228.Xr open 2
229call requested write access. 229call requested write access.
230.It Er 27 EFBIG Em "File too large" . 230.It Er 27 EFBIG Em "File too large" .
231The size of a file exceeded the maximum. 231The size of a file exceeded the maximum.
232(The system-wide maximum file size is 232(The system-wide maximum file size is
233.if t 2\u\s-263\s+2\d 233.if t 2\u\s-263\s+2\d
234.if n 2**63 234.if n 2**63
235bytes. 235bytes.
236Each file system may impose a lower limit for files contained within it). 236Each file system may impose a lower limit for files contained within it).
237.It Er 28 ENOSPC Em "Device out of space" . 237.It Er 28 ENOSPC Em "Device out of space" .
238A 238A
239.Xr write 2 239.Xr write 2
240to an ordinary file, the creation of a 240to an ordinary file, the creation of a
241directory or symbolic link, or the creation of a directory 241directory or symbolic link, or the creation of a directory
242entry failed because no more disk blocks were available 242entry failed because no more disk blocks were available
243on the file system, or the allocation of an inode for a newly 243on the file system, or the allocation of an inode for a newly
244created file failed because no more inodes were available 244created file failed because no more inodes were available
245on the file system. 245on the file system.
246.It Er 29 ESPIPE Em "Illegal seek" . 246.It Er 29 ESPIPE Em "Illegal seek" .
247An 247An
248.Xr lseek 2 248.Xr lseek 2
249function was issued on a socket, pipe or 249function was issued on a socket, pipe or
250.Tn FIFO . 250.Tn FIFO .
251.It Er 30 EROFS Em "Read-only file system" . 251.It Er 30 EROFS Em "Read-only file system" .
252An attempt was made to modify a file or directory 252An attempt was made to modify a file or directory
253was made 253was made
254on a file system that was read-only at the time. 254on a file system that was read-only at the time.
255.It Er 31 EMLINK Em "Too many links" . 255.It Er 31 EMLINK Em "Too many links" .
256The number of hard links to a single file has exceeded the maximum. 256The number of hard links to a single file has exceeded the maximum.
257(The system-wide maximum number of hard links is 32767. 257(The system-wide maximum number of hard links is 32767.
258Each file system may impose a lower limit for files contained within it). 258Each file system may impose a lower limit for files contained within it).
259.It Er 32 EPIPE Em "Broken pipe" . 259.It Er 32 EPIPE Em "Broken pipe" .
260A write on a pipe, socket or 260A write on a pipe, socket or
261.Tn FIFO 261.Tn FIFO
262for which there is no process 262for which there is no process
263to read the data. 263to read the data.
264.It Er 33 EDOM Em "Numerical argument out of domain" . 264.It Er 33 EDOM Em "Numerical argument out of domain" .
265A numerical input argument was outside the defined domain of the mathematical 265A numerical input argument was outside the defined domain of the mathematical
266function. 266function.
267.It Er 34 ERANGE Em "Result too large or too small" . 267.It Er 34 ERANGE Em "Result too large or too small" .
268The result of the function is too large or too small to be represented 268The result of the function is too large or too small to be represented
269in the available space. 269in the available space.
270.It Er 35 EAGAIN Em "Resource temporarily unavailable" . 270.It Er 35 EAGAIN Em "Resource temporarily unavailable" .
271This is a temporary condition and later calls to the 271This is a temporary condition and later calls to the
272same routine may complete normally. 272same routine may complete normally.
273.It Er 36 EINPROGRESS Em "Operation now in progress" . 273.It Er 36 EINPROGRESS Em "Operation now in progress" .
274An operation that takes a long time to complete (such as 274An operation that takes a long time to complete (such as
275a 275a
276.Xr connect 2 ) 276.Xr connect 2 )
277was attempted on a non-blocking object (see 277was attempted on a non-blocking object (see
278.Xr fcntl 2 ) . 278.Xr fcntl 2 ) .
279.It Er 37 EALREADY Em "Operation already in progress" . 279.It Er 37 EALREADY Em "Operation already in progress" .
280An operation was attempted on a non-blocking object that already 280An operation was attempted on a non-blocking object that already
281had an operation in progress. 281had an operation in progress.
282.It Er 38 ENOTSOCK Em "Socket operation on non-socket" . 282.It Er 38 ENOTSOCK Em "Socket operation on non-socket" .
283Self-explanatory. 283Self-explanatory.
284.It Er 39 EDESTADDRREQ Em "Destination address required" . 284.It Er 39 EDESTADDRREQ Em "Destination address required" .
285A required address was omitted from an operation on a socket. 285A required address was omitted from an operation on a socket.
286.It Er 40 EMSGSIZE Em "Message too long" . 286.It Er 40 EMSGSIZE Em "Message too long" .
287A message sent on a socket was larger than the internal message buffer 287A message sent on a socket was larger than the internal message buffer
288or some other network limit. 288or some other network limit.
289.It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" . 289.It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" .
290A protocol was specified that does not support the semantics of the 290A protocol was specified that does not support the semantics of the
291socket type requested. 291socket type requested.
292For example, you cannot use the 292For example, you cannot use the
293.Tn ARPA 293.Tn ARPA
294Internet 294Internet
295.Tn UDP 295.Tn UDP
296protocol with type 296protocol with type
297.Dv SOCK_STREAM . 297.Dv SOCK_STREAM .
298.It Er 42 ENOPROTOOPT Em "Protocol option not available" . 298.It Er 42 ENOPROTOOPT Em "Protocol option not available" .
299A bad option or level was specified in a 299A bad option or level was specified in a
300.Xr getsockopt 2 300.Xr getsockopt 2
301or 301or
302.Xr setsockopt 2 302.Xr setsockopt 2
303call. 303call.
304.It Er 43 EPROTONOSUPPORT Em "Protocol not supported" . 304.It Er 43 EPROTONOSUPPORT Em "Protocol not supported" .
305The protocol has not been configured into the 305The protocol has not been configured into the
306system or no implementation for it exists. 306system or no implementation for it exists.
307.It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" . 307.It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" .
308The support for the socket type has not been configured into the 308The support for the socket type has not been configured into the
309system or no implementation for it exists. 309system or no implementation for it exists.
310.It Er 45 EOPNOTSUPP Em "Operation not supported" . 310.It Er 45 EOPNOTSUPP Em "Operation not supported" .
311The attempted operation is not supported for the type of object referenced. 311The attempted operation is not supported for the type of object referenced.
312Usually this occurs when a file descriptor refers to a file or socket 312Usually this occurs when a file descriptor refers to a file or socket
313that cannot support this operation, 313that cannot support this operation,
314for example, trying to 314for example, trying to
315.Em accept 315.Em accept
316a connection on a datagram socket. 316a connection on a datagram socket.
317.It Er 46 EPFNOSUPPORT Em "Protocol family not supported" . 317.It Er 46 EPFNOSUPPORT Em "Protocol family not supported" .
318The protocol family has not been configured into the 318The protocol family has not been configured into the
319system or no implementation for it exists. 319system or no implementation for it exists.
320.It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" . 320.It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" .
321An address incompatible with the requested protocol was used. 321An address incompatible with the requested protocol was used.
322For example, you shouldn't necessarily expect to be able to use 322For example, you shouldn't necessarily expect to be able to use
323.Tn NS 323.Tn NS
324addresses with 324addresses with
325.Tn ARPA 325.Tn ARPA
326Internet protocols. 326Internet protocols.
327.It Er 48 EADDRINUSE Em "Address already in use" . 327.It Er 48 EADDRINUSE Em "Address already in use" .
328Only one usage of each address is normally permitted. 328Only one usage of each address is normally permitted.
329.It Er 49 EADDRNOTAVAIL Em "Cannot assign requested address" . 329.It Er 49 EADDRNOTAVAIL Em "Cannot assign requested address" .
330Normally results from an attempt to create a socket with an 330Normally results from an attempt to create a socket with an
331address not on this machine. 331address not on this machine.
332.It Er 50 ENETDOWN Em "Network is down" . 332.It Er 50 ENETDOWN Em "Network is down" .
333A socket operation encountered a dead network. 333A socket operation encountered a dead network.
334.It Er 51 ENETUNREACH Em "Network is unreachable" . 334.It Er 51 ENETUNREACH Em "Network is unreachable" .
335A socket operation was attempted to an unreachable network. 335A socket operation was attempted to an unreachable network.
336.It Er 52 ENETRESET Em "Network dropped connection on reset" . 336.It Er 52 ENETRESET Em "Network dropped connection on reset" .
337The host you were connected to crashed and rebooted. 337The host you were connected to crashed and rebooted.
338.It Er 53 ECONNABORTED Em "Software caused connection abort" . 338.It Er 53 ECONNABORTED Em "Software caused connection abort" .
339A connection abort was caused internal to your host machine. 339A connection abort was caused internal to your host machine.
340.It Er 54 ECONNRESET Em "Connection reset by peer" . 340.It Er 54 ECONNRESET Em "Connection reset by peer" .
341A connection was forcibly closed by a peer. 341A connection was forcibly closed by a peer.
342This normally results from a loss of the connection on the remote 342This normally results from a loss of the connection on the remote
343socket due to a timeout or a reboot. 343socket due to a timeout or a reboot.
344.It Er 55 ENOBUFS Em "\&No buffer space available" . 344.It Er 55 ENOBUFS Em "\&No buffer space available" .
345An operation on a socket or pipe was not performed because 345An operation on a socket or pipe was not performed because
346the system lacked sufficient buffer space or because a queue was full. 346the system lacked sufficient buffer space or because a queue was full.
347.It Er 56 EISCONN Em "Socket is already connected" . 347.It Er 56 EISCONN Em "Socket is already connected" .
348A 348A
349.Xr connect 2 349.Xr connect 2
350request was made on an already connected socket; or, 350request was made on an already connected socket; or,
351a 351a
352.Xr sendto 2 352.Xr sendto 2
353or 353or
354.Xr sendmsg 2 354.Xr sendmsg 2
355request on a connected socket specified a destination 355request on a connected socket specified a destination
356when already connected. 356when already connected.
357.It Er 57 ENOTCONN Em "Socket is not connected" . 357.It Er 57 ENOTCONN Em "Socket is not connected" .
358An request to send or receive data was disallowed because 358An request to send or receive data was disallowed because
359the socket was not connected and (when sending on a datagram socket) 359the socket was not connected and (when sending on a datagram socket)
360no address was supplied. 360no address was supplied.
361.It Er 58 ESHUTDOWN Em "Cannot send after socket shutdown" . 361.It Er 58 ESHUTDOWN Em "Cannot send after socket shutdown" .
362A request to send data was disallowed because the socket 362A request to send data was disallowed because the socket
363had already been shut down with a previous 363had already been shut down with a previous
364.Xr shutdown 2 364.Xr shutdown 2
365call. 365call.
366.It Er 59 ETOOMANYREFS Em "Too many references: can't splice" . 366.It Er 59 ETOOMANYREFS Em "Too many references: can't splice" .
367The resource is used up to capacity. 367The resource is used up to capacity.
368.It Er 60 ETIMEDOUT Em "Operation timed out" . 368.It Er 60 ETIMEDOUT Em "Operation timed out" .
369A 369A
370.Xr connect 2 370.Xr connect 2
371or 371or
372.Xr send 2 372.Xr send 2
373request failed because the connected party did not 373request failed because the connected party did not
374properly respond after a period of time. 374properly respond after a period of time.
375(The timeout period is dependent on the communication protocol). 375(The timeout period is dependent on the communication protocol).
376.It Er 61 ECONNREFUSED Em "Connection refused" . 376.It Er 61 ECONNREFUSED Em "Connection refused" .
377No connection could be made because the target machine actively 377No connection could be made because the target machine actively
378refused it. 378refused it.
379This usually results from trying to connect 379This usually results from trying to connect
380to a service that is inactive on the foreign host. 380to a service that is inactive on the foreign host.
381.It Er 62 ELOOP Em "Too many levels of symbolic links" . 381.It Er 62 ELOOP Em "Too many levels of symbolic links" .
382A path name lookup involved more than 32 382A path name lookup involved more than 32
383.Pq Dv MAXSYMLINKS 383.Pq Dv MAXSYMLINKS
384symbolic links. 384symbolic links.
385.It Er 63 ENAMETOOLONG Em "File name too long" . 385.It Er 63 ENAMETOOLONG Em "File name too long" .
386A component of a path name exceeded 255 386A component of a path name exceeded 255
387.Pq Dv MAXNAMELEN 387.Pq Dv MAXNAMELEN
388characters, or an entire 388characters, or an entire
389path name exceeded 1023 389path name exceeded 1023
390.Pq Dv MAXPATHLEN Ns \-1 390.Pq Dv MAXPATHLEN Ns \-1
391characters. 391characters.
392.It Er 64 EHOSTDOWN Em "Host is down" . 392.It Er 64 EHOSTDOWN Em "Host is down" .
393A socket operation failed because the destination host was down. 393A socket operation failed because the destination host was down.
394.It Er 65 EHOSTUNREACH Em "No route to host" . 394.It Er 65 EHOSTUNREACH Em "No route to host" .
395A socket operation was attempted to an unreachable host. 395A socket operation was attempted to an unreachable host.
396.It Er 66 ENOTEMPTY Em "Directory not empty" . 396.It Er 66 ENOTEMPTY Em "Directory not empty" .
397A directory with entries other than 397A directory with entries other than
398.Ql \&. 398.Ql \&.
399and 399and
400.Ql \&.. 400.Ql \&..
401was supplied to a remove directory or rename call. 401was supplied to a remove directory or rename call.
402.It Er 67 EPROCLIM Em "Too many processes" . 402.It Er 67 EPROCLIM Em "Too many processes" .
403.It Er 68 EUSERS Em "Too many users" . 403.It Er 68 EUSERS Em "Too many users" .
404The quota system ran out of table entries. 404The quota system ran out of table entries.
405.It Er 69 EDQUOT Em "Disc quota exceeded" . 405.It Er 69 EDQUOT Em "Disc quota exceeded" .
406A 406A
407.Xr write 2 407.Xr write 2
408to an ordinary file, the creation of a 408to an ordinary file, the creation of a
409directory or symbolic link, or the creation of a directory 409directory or symbolic link, or the creation of a directory
410entry failed because the user's quota of disk blocks was 410entry failed because the user's quota of disk blocks was
411exhausted, or the allocation of an inode for a newly 411exhausted, or the allocation of an inode for a newly
412created file failed because the user's quota of inodes 412created file failed because the user's quota of inodes
413was exhausted. 413was exhausted.
414.It Er 70 ESTALE Em "Stale NFS file handle" . 414.It Er 70 ESTALE Em "Stale NFS file handle" .
415An attempt was made to access an open file (on an 415An attempt was made to access an open file (on an
416.Tn NFS 416.Tn NFS
417filesystem) 417filesystem)
418which is now unavailable as referenced by the file descriptor. 418which is now unavailable as referenced by the file descriptor.
419This may indicate the file was deleted on the 419This may indicate the file was deleted on the
420.Tn NFS 420.Tn NFS
421server or some other catastrophic event occurred. 421server or some other catastrophic event occurred.
422.It Er 71 EREMOTE Em "Too many levels of remote in path" . 422.It Er 71 EREMOTE Em "Too many levels of remote in path" .
423.Tn NFS 423.Tn NFS
424version 3 RPC return code 71. 424version 3 RPC return code 71.
425.It Er 72 EBADRPC Em "RPC struct is bad" . 425.It Er 72 EBADRPC Em "RPC struct is bad" .
426Exchange of 426Exchange of
427.Tn RPC 427.Tn RPC
428information was unsuccessful. 428information was unsuccessful.
429.It Er 73 ERPCMISMATCH Em "RPC version wrong" . 429.It Er 73 ERPCMISMATCH Em "RPC version wrong" .
430The version of 430The version of
431.Tn RPC 431.Tn RPC
432on the remote peer is not compatible with 432on the remote peer is not compatible with
433the local version. 433the local version.
434.It Er 74 EPROGUNAVAIL Em "RPC prog. not avail" . 434.It Er 74 EPROGUNAVAIL Em "RPC prog. not avail" .
435The requested program is not registered on the remote host. 435The requested program is not registered on the remote host.
436.It Er 75 EPROGMISMATCH Em "Program version wrong" . 436.It Er 75 EPROGMISMATCH Em "Program version wrong" .
437The requested version of the program is not available 437The requested version of the program is not available
438on the remote host 438on the remote host
439.Pq Tn RPC . 439.Pq Tn RPC .
440.It Er 76 EPROCUNAVAIL Em "Bad procedure for program" . 440.It Er 76 EPROCUNAVAIL Em "Bad procedure for program" .
441An 441An
442.Tn RPC 442.Tn RPC
443call was attempted for a procedure which doesn't exist 443call was attempted for a procedure which doesn't exist
444in the remote program. 444in the remote program.
445.It Er 77 ENOLCK Em "No locks available" . 445.It Er 77 ENOLCK Em "No locks available" .
446A system-imposed limit on the number of simultaneous file 446A system-imposed limit on the number of simultaneous file
447locks was reached. 447locks was reached.
448.It Er 78 ENOSYS Em "Function not implemented" . 448.It Er 78 ENOSYS Em "Function not implemented" .
449Attempted a system call that is not available on this 449Attempted a system call that is not available on this
450system. 450system.
451.It Er 79 EFTYPE Em "Inappropriate file type or format" . 451.It Er 79 EFTYPE Em "Inappropriate file type or format" .
452Attempted a file operation on a file of a type for which it was invalid. 452Attempted a file operation on a file of a type for which it was invalid.
453.It Er 80 EAUTH Em "Authentication error" . 453.It Er 80 EAUTH Em "Authentication error" .
454Attempted to use an invalid authentication ticket to mount an 454Attempted to use an invalid authentication ticket to mount an
455.Tn NFS 455.Tn NFS
456filesystem. 456filesystem.
457.It Er 81 ENEEDAUTH Em "Need authenticator" . 457.It Er 81 ENEEDAUTH Em "Need authenticator" .
458An authentication ticket must be obtained before the given 458An authentication ticket must be obtained before the given
459.Tn NFS 459.Tn NFS
460filesystem may be mounted. 460filesystem may be mounted.
461.It Er 82 EIDRM Em "Identifier removed" . 461.It Er 82 EIDRM Em "Identifier removed" .
462An IPC identifier was removed while the current process was waiting on it. 462An IPC identifier was removed while the current process was waiting on it.
463.It Er 83 ENOMSG Em "No message of the desired type" . 463.It Er 83 ENOMSG Em "No message of the desired type" .
464An IPC message queue does not contain a message of the desired type, 464An IPC message queue does not contain a message of the desired type,
465or a message catalog does not contain the requested message. 465or a message catalog does not contain the requested message.
466.It Er 84 EOVERFLOW Em "Value too large to be stored in data type" . 466.It Er 84 EOVERFLOW Em "Value too large to be stored in data type" .
467A numerical result of the function was too large to be stored in the 467A numerical result of the function was too large to be stored in the
468caller-provided space. 468caller-provided space.
469.It Er 85 EILSEQ Em "Illegal byte sequence" . 469.It Er 85 EILSEQ Em "Illegal byte sequence" .
470A wide character/multibyte character encoding error occurred. 470A wide character/multibyte character encoding error occurred.
471.It Er 86 ENOTSUP Em "Not supported" . 471.It Er 86 ENOTSUP Em "Not supported" .
472An attempt was made to set or change a parameter to an unsupported 472An attempt was made to set or change a parameter to an unsupported
473value. 473value.
474.It Er 87 ECANCELED Em "Operation canceled" . 474.It Er 87 ECANCELED Em "Operation canceled" .
475The requested operation was canceled. 475The requested operation was canceled.
476.It Er 88 EBADMSG Em "Bad or corrupt message" . 476.It Er 88 EBADMSG Em "Bad or corrupt message" .
477A message in the specified message catalog did not satisfy implementation 477A message in the specified message catalog did not satisfy implementation
478defined criteria, or a STREAMS operation encountered an invalid message or 478defined criteria, or a STREAMS operation encountered an invalid message or
479a file descriptor at the STREAM head. 479a file descriptor at the STREAM head.
480.It Er 89 ENODATA Em "No message available" . 480.It Er 89 ENODATA Em "No message available" .
481No message is available on the STREAM head read queue 481No message is available on the STREAM head read queue
482.It Er 90 ENOSR Em "No STREAM resources" . 482.It Er 90 ENOSR Em "No STREAM resources" .
483Buffers could not be allocated due to insufficient STREAMs memory resources. 483Buffers could not be allocated due to insufficient STREAMs memory resources.
484.It Er 91 ENOSTR Em "Not a STREAM" . 484.It Er 91 ENOSTR Em "Not a STREAM" .
485A STREAM is not associated with the specified file descriptor. 485A STREAM is not associated with the specified file descriptor.
486.It Er 92 ETIME Em "STREAM ioctl timeout" . 486.It Er 92 ETIME Em "STREAM ioctl timeout" .
487The timer set for a STREAMS 487The timer set for a STREAMS
488.Xr ioctl 2 488.Xr ioctl 2
489operation has expired. 489operation has expired.
490.It Er 93 ENOATTR Em "Attribute not found" . 490.It Er 93 ENOATTR Em "Attribute not found" .
491The specified extended attribute does not exist. 491The specified extended attribute does not exist.
492.It Er 94 EMULTIHOP Em "Multihop attempted" . 492.It Er 94 EMULTIHOP Em "Multihop attempted" .
493Components of path require hopping to multiple remote machines and the 493Components of path require hopping to multiple remote machines and the
494file system does not allow it. 494file system does not allow it.
495It occurs when users try to access remote resources which are not directly 495It occurs when users try to access remote resources which are not directly
496accessible. 496accessible.
497.It Er 95 ENOLINK Em "Link has been severed" . 497.It Er 95 ENOLINK Em "Link has been severed" .
498Occurs when the link (virtual circuit) connecting to a remote machine is gone. 498Occurs when the link (virtual circuit) connecting to a remote machine is gone.
499.It Er 96 EPROTO Em "Protocol error" . 499.It Er 96 EPROTO Em "Protocol error" .
500Some protocol error occurred. 500Some protocol error occurred.
501This error is device-specific, but is generally not related to a hardware 501This error is device-specific, but is generally not related to a hardware
502failure. 502failure.
503.El 503.El
504.Sh DEFINITIONS 504.Sh DEFINITIONS
505.Bl -tag -width Ds 505.Bl -tag -width Ds
506.It Process ID 506.It Process ID
507Each active process in the system is uniquely identified by a non-negative 507Each active process in the system is uniquely identified by a non-negative
508integer called a process ID. 508integer called a process ID.
509The range of this ID is from 0 to 30000. 509The range of this ID is from 0 to 30000.
510.It Parent process ID 510.It Parent process ID
511A new process is created by a currently active process; (see 511A new process is created by a currently active process; (see
512.Xr fork 2 ) . 512.Xr fork 2 ) .
513The parent process ID of a process is initially the process ID of its creator. 513The parent process ID of a process is initially the process ID of its creator.
514If the creating process exits, 514If the creating process exits,
515the parent process ID of each child is set to the ID of a system process, 515the parent process ID of each child is set to the ID of a system process,
516.Xr init 8 . 516.Xr init 8 .
517.It Process Group 517.It Process Group
518Each active process is a member of a process group that is identified by 518Each active process is a member of a process group that is identified by
519a non-negative integer called the process group ID. 519a non-negative integer called the process group ID.
520This is the process ID of the group leader. 520This is the process ID of the group leader.
521This grouping permits the signaling of related processes (see 521This grouping permits the signaling of related processes (see
522.Xr termios 4 ) 522.Xr termios 4 )
523and the job control mechanisms of 523and the job control mechanisms of
524.Xr csh 1 . 524.Xr csh 1 .
525.It Session 525.It Session
526A session is a set of one or more process groups. 526A session is a set of one or more process groups.
527A session is created by a successful call to 527A session is created by a successful call to
528.Xr setsid 2 , 528.Xr setsid 2 ,
529which causes the caller to become the only member of the only process 529which causes the caller to become the only member of the only process
530group in the new session. 530group in the new session.
531.It Session leader 531.It Session leader
532A process that has created a new session by a successful call to 532A process that has created a new session by a successful call to
533.Xr setsid 2 , 533.Xr setsid 2 ,
534is known as a session leader. 534is known as a session leader.
535Only a session leader may acquire a terminal as its controlling terminal (see 535Only a session leader may acquire a terminal as its controlling terminal (see
536.Xr termios 4 ) . 536.Xr termios 4 ) .
537.It Controlling process 537.It Controlling process
538A session leader with a controlling terminal is a controlling process. 538A session leader with a controlling terminal is a controlling process.
539.It Controlling terminal 539.It Controlling terminal
540A terminal that is associated with a session is known as the controlling 540A terminal that is associated with a session is known as the controlling
541terminal for that session and its members. 541terminal for that session and its members.
542.It "Terminal Process Group ID" 542.It "Terminal Process Group ID"
543A terminal may be acquired by a session leader as its controlling terminal. 543A terminal may be acquired by a session leader as its controlling terminal.
544Once a terminal is associated with a session, any of the process groups 544Once a terminal is associated with a session, any of the process groups
545within the session may be placed into the foreground by setting 545within the session may be placed into the foreground by setting
546the terminal process group ID to the ID of the process group. 546the terminal process group ID to the ID of the process group.
547This facility is used 547This facility is used
548to arbitrate between multiple jobs contending for the same terminal. 548to arbitrate between multiple jobs contending for the same terminal.
549(See 549(See
550.Xr csh 1 550.Xr csh 1
551and 551and
552.Xr tty 4 552.Xr tty 4
553for more information on job control.) 553for more information on job control.)
554.It "Orphaned Process Group" 554.It "Orphaned Process Group"
555A process group is considered to be 555A process group is considered to be
556.Em orphaned 556.Em orphaned
557if it is not under the control of a job control shell. 557if it is not under the control of a job control shell.
558More precisely, a process group is orphaned 558More precisely, a process group is orphaned
559when none of its members has a parent process that is in the same session 559when none of its members has a parent process that is in the same session
560as the group, 560as the group,
561but is in a different process group. 561but is in a different process group.
562Note that when a process exits, the parent process for its children 562Note that when a process exits, the parent process for its children
563is changed to be 563is changed to be
564.Xr init 8 , 564.Xr init 8 ,
565which is in a separate session. 565which is in a separate session.
566Not all members of an orphaned process group are necessarily orphaned 566Not all members of an orphaned process group are necessarily orphaned
567processes (those whose creating process has exited). 567processes (those whose creating process has exited).
568The process group of a session leader is orphaned by definition. 568The process group of a session leader is orphaned by definition.
569.It "Real User ID and Real Group ID" 569.It "Real User ID and Real Group ID"
570Each user on the system is identified by a positive integer 570Each user on the system is identified by a positive integer
571termed the real user ID. 571termed the real user ID.
572.Pp 572.Pp
573Each user is also a member of one or more groups. 573Each user is also a member of one or more groups.
574One of these groups is distinguished from others and 574One of these groups is distinguished from others and
575used in implementing accounting facilities. 575used in implementing accounting facilities.
576The positive integer corresponding to this distinguished group is 576The positive integer corresponding to this distinguished group is
577termed the real group ID. 577termed the real group ID.
578.Pp 578.Pp
579All processes have a real user ID and real group ID. 579All processes have a real user ID and real group ID.
580These are initialized from the equivalent attributes 580These are initialized from the equivalent attributes
581of the process that created it. 581of the process that created it.
582.It "Effective User Id, Effective Group Id, and Group Access List" 582.It "Effective User Id, Effective Group Id, and Group Access List"
583Access to system resources is governed by two values: 583Access to system resources is governed by two values:
584the effective user ID, and the group access list. 584the effective user ID, and the group access list.
585The first member of the group access list is also known as the 585The first member of the group access list is also known as the
586effective group ID. 586effective group ID.
587(In POSIX.1, the group access list is known as the set of supplementary 587(In POSIX.1, the group access list is known as the set of supplementary
588group IDs, and it is unspecified whether the effective group ID is 588group IDs, and it is unspecified whether the effective group ID is
589a member of the list.) 589a member of the list.)
590.Pp 590.Pp
591The effective user ID and effective group ID are initially the 591The effective user ID and effective group ID are initially the
592process's real user ID and real group ID respectively. 592process's real user ID and real group ID respectively.
593Either may be modified through execution of a set-user-ID or 593Either may be modified through execution of a set-user-ID or
594set-group-ID file (possibly by one of its ancestors) (see 594set-group-ID file (possibly by one of its ancestors) (see
595.Xr execve 2 ) . 595.Xr execve 2 ) .
596By convention, the effective group ID (the first member of the group access 596By convention, the effective group ID (the first member of the group access
597list) is duplicated, so that the execution of a set-group-ID program 597list) is duplicated, so that the execution of a set-group-ID program
598does not result in the loss of the original (real) group ID. 598does not result in the loss of the original (real) group ID.
599.Pp 599.Pp
600The group access list is a set of group IDs 600The group access list is a set of group IDs
601used only in determining resource accessibility. 601used only in determining resource accessibility.
602Access checks are performed as described below in 602Access checks are performed as described below in
603.Qq File Access Permissions . 603.Qq File Access Permissions .
604.It "Saved Set User ID and Saved Set Group ID" 604.It "Saved Set User ID and Saved Set Group ID"
605When a process executes a new file, the effective user ID is set 605When a process executes a new file, the effective user ID is set
606to the owner of the file if the file is set-user-ID, and the effective 606to the owner of the file if the file is set-user-ID, and the effective
607group ID (first element of the group access list) is set to the group 607group ID (first element of the group access list) is set to the group
608of the file if the file is set-group-ID. 608of the file if the file is set-group-ID.
609The effective user ID of the process is then recorded as the saved set-user-ID, 609The effective user ID of the process is then recorded as the saved set-user-ID,
610and the effective group ID of the process is recorded as the saved set-group-ID. 610and the effective group ID of the process is recorded as the saved set-group-ID.
611These values may be used to regain those values as the effective user 611These values may be used to regain those values as the effective user
612or group ID after reverting to the real ID (see 612or group ID after reverting to the real ID (see
613.Xr setuid 2 ) . 613.Xr setuid 2 ) .
614(In POSIX.1, the saved set-user-ID and saved set-group-ID are optional, 614(In POSIX.1, the saved set-user-ID and saved set-group-ID are optional,
615and are used in setuid and setgid, but this does not work as desired 615and are used in setuid and setgid, but this does not work as desired
616for the super-user.) 616for the super-user.)
617.It Super-user 617.It Super-user
618A process is recognized as a 618A process is recognized as a
619.Em super-user 619.Em super-user
620process and is granted special privileges if its effective user ID is 0. 620process and is granted special privileges if its effective user ID is 0.
621.It Special Processes 621.It Special Processes
622The processes with process IDs of 0 and 1 are special. 622The processes with process IDs of 0 and 1 are special.
623Process 0 is the scheduler. 623Process 0 is the scheduler.
624Process 1 is the initialization process 624Process 1 is the initialization process
625.Xr init 8 , 625.Xr init 8 ,
626and is the ancestor (parent) of every other process in the system. 626and is the ancestor (parent) of every other process in the system.
627It is used to control the process structure. 627It is used to control the process structure.
628The kernel will allocate other kernel threads to handle certain 628The kernel will allocate other kernel threads to handle certain
629periodic tasks or device related tasks, such as: 629periodic tasks or device related tasks, such as:
630.Bl -tag -width pagedaemon 630.Bl -tag -width pagedaemon
631.It Sy acctwatch 631.It Sy acctwatch
632System accounting disk watcher, see 632System accounting disk watcher, see
633.Xr acct 2 , 633.Xr acct 2 ,
634.Xr acct 5 . 634.Xr acct 5 .
635.It Sy aiodoned 635.It Sy aiodoned
636Asynchronous I/O done handler, see 636Asynchronous I/O done handler, see
637.Xr uvm 9 . 637.Xr uvm 9 .
638.It Sy atabusX 638.It Sy atabusX
639ATA bus handler, see 639ATA bus handler, see
640.Xr ata 4 . 640.Xr ata 4 .
641.It Sy cardslotX 641.It Sy cardslotX
642CardBus slot watcher thread, see 642CardBus slot watcher thread, see
643.Xr cardslot 4 . 643.Xr cardslot 4 .
644.It Sy cryptoret 644.It Sy cryptoret
645The software crypto daemon. 645The software crypto daemon.
646.It Sy fssbsX 646.It Sy fssbsX
647File system snapshot thread, see 647File system snapshot thread, see
648.Xr fss 4 . 648.Xr fss 4 .
649.It Sy ioflush 649.It Sy ioflush
650The in-kernel periodic flush the buffer cache to disk task, 650The in-kernel periodic flush the buffer cache to disk task,
651which replaces the old 651which replaces the old
652.Sy update 652.Sy update
653program. 653program.
654.It Sy nfsio , nfskqpoll 654.It Sy nfsio , nfskqpoll
655NFS handing daemons. 655NFS handing daemons.
656.It Sy lfs_writer 656.It Sy lfs_writer
657Log filesystem writer. 657Log filesystem writer.
658.It Sy pagedaemon 658.It Sy pagedaemon
659The page daemon. 659The page daemon.
660.It Sy raidX , raidioX , raid_parity , raid_recon , raid_reconip , raid_copyback 660.It Sy raidX , raidioX , raid_parity , raid_recon , raid_reconip , raid_copyback
661Raid framework related threads, see 661Raid framework related threads, see
662.Xr raid 4 . 662.Xr raid 4 .
663.It Sy scsibusX 663.It Sy scsibusX
664SCSI bus handler, see 664SCSI bus handler, see
665.Xr scsi 4 . 665.Xr scsi 4 .
666.It Sy smbiodX , smbkq 666.It Sy smbiodX , smbkq
667SMBFS handling daemon, see 667SMBFS handling daemon, see
668.Xr netsmb 4 . 668.Xr netsmb 4 .
669.It Sy swdmover 669.It Sy swdmover
670The software data mover I/O thread, see 670The software data mover I/O thread, see
671.Xr dmoverio 4 . 671.Xr dmoverio 4 .
672.It Sy sysmon 672.It Sy sysmon
673The systems monitoring framework daemon. 673The systems monitoring framework daemon.
674.It Sy usbX , usbtask 674.It Sy usbX , usbtask
675USB bus handler, see 675USB bus handler, see
676.Xr usb 4 . 676.Xr usb 4 .
677.El 677.El
678.Pp 678.Pp
679There are more machine-dependent kernel threads allocated by 679There are more machine-dependent kernel threads allocated by
680different drivers. 680different drivers.
681See the specific driver manual pages for more information. 681See the specific driver manual pages for more information.
682.It Descriptor 682.It Descriptor
683An integer assigned by the system when a file is referenced 683An integer assigned by the system when a file is referenced
684by 684by
685.Xr open 2 685.Xr open 2
686or 686or
687.Xr dup 2 , 687.Xr dup 2 ,
688or when a socket is created by 688or when a socket is created by
689.Xr pipe 2 , 689.Xr pipe 2 ,
690.Xr socket 2 , 690.Xr socket 2 ,
691or 691or
692.Xr socketpair 2 , 692.Xr socketpair 2 ,
693which uniquely identifies an access path to that file or socket from 693which uniquely identifies an access path to that file or socket from
694a given process or any of its children. 694a given process or any of its children.
695.It File Name 695.It File Name
696Names consisting of up to 255 696Names consisting of up to 255
697.Pq Dv MAXNAMELEN 697.Pq Dv MAXNAMELEN
698characters may be used to name 698characters may be used to name
699an ordinary file, special file, or directory. 699an ordinary file, special file, or directory.
700.Pp 700.Pp
701These characters may be selected from the set of all 701These characters may be selected from the set of all
702.Tn ASCII 702.Tn ASCII
703character 703character
704excluding 0 (NUL) and the 704excluding 0 (NUL) and the
705.Tn ASCII 705.Tn ASCII
706code for 706code for
707.Ql \&/ 707.Ql \&/
708(slash). 708(slash).
709(The parity bit, bit 7, must be 0). 709(The parity bit, bit 7, must be 0).
710.Pp 710.Pp
711Note that it is generally unwise to use 711Note that it is generally unwise to use
712.Ql \&* , 712.Ql \&* ,
713.Ql \&? , 713.Ql \&? ,
714.Ql \&[ 714.Ql \&[
715or 715or
716.Ql \&] 716.Ql \&]
717as part of 717as part of
718file names because of the special meaning attached to these characters 718file names because of the special meaning attached to these characters
719by the shell. 719by the shell.
720.It Pathname 720.It Pathname
721A path name is a 721A path name is a
722.Tn NUL Ns -terminated 722.Tn NUL Ns -terminated
723character string starting with an 723character string starting with an
724optional slash 724optional slash
725.Ql \&/ , 725.Ql \&/ ,
726followed by zero or more directory names separated 726followed by zero or more directory names separated
727by slashes, optionally followed by a file name. 727by slashes, optionally followed by a file name.
728The total length of a path name must be less than 1024 728The total length of a path name must be less than 1024
729.Pq Dv MAXPATHLEN 729.Pq Dv MAXPATHLEN
730characters. 730characters.
731.Pp 731.Pp
732If a path name begins with a slash, the path search begins at the 732If a path name begins with a slash, the path search begins at the
733.Em root 733.Em root
734directory. 734directory.
735Otherwise, the search begins from the current working directory. 735Otherwise, the search begins from the current working directory.
736A slash by itself names the root directory. 736A slash by itself names the root directory.
737An empty string is not a valid pathname. 737An empty string is not a valid pathname.
738.It Directory 738.It Directory
739A directory is a special type of file that contains entries 739A directory is a special type of file that contains entries
740that are references to other files. 740that are references to other files.
741Directory entries are called links. 741Directory entries are called links.
742By convention, a directory contains at least two links, 742By convention, a directory contains at least two links,
743.Ql \&. 743.Ql \&.
744and 744and
745.Ql \&.. , 745.Ql \&.. ,
746referred to as 746referred to as
747.Em dot 747.Em dot
748and 748and
749.Em dot-dot 749.Em dot-dot
750respectively. 750respectively.
751Dot refers to the directory itself and dot-dot refers to its parent directory. 751Dot refers to the directory itself and dot-dot refers to its parent directory.
752.It "Root Directory and Current Working Directory" 752.It "Root Directory and Current Working Directory"
753Each process has associated with it a concept of a root directory 753Each process has associated with it a concept of a root directory
754and a current working directory for the purpose of resolving path 754and a current working directory for the purpose of resolving path
755name searches. 755name searches.
756A process's root directory need not be the root 756A process's root directory need not be the root
757directory of the root file system. 757directory of the root file system.
758.It File Access Permissions 758.It File Access Permissions
759Every file in the file system has a set of access permissions. 759Every file in the file system has a set of access permissions.
760These permissions are used in determining whether a process 760These permissions are used in determining whether a process
761may perform a requested operation on the file (such as opening 761may perform a requested operation on the file (such as opening
762a file for writing). 762a file for writing).
763Access permissions are established at the time a file is created. 763Access permissions are established at the time a file is created.
764They may be changed at some later time through the 764They may be changed at some later time through the
765.Xr chmod 2 765.Xr chmod 2
766call. 766call.
767.Pp 767.Pp
768File access is broken down according to whether a file may be: read, 768File access is broken down according to whether a file may be: read,
769written, or executed. 769written, or executed.
770Directory files use the execute permission to control if the 770Directory files use the execute permission to control if the
771directory may be searched. 771directory may be searched.
772.Pp 772.Pp
773File access permissions are interpreted by the system as 773File access permissions are interpreted by the system as
774they apply to three different classes of users: the owner 774they apply to three different classes of users: the owner
775of the file, those users in the file's group, anyone else. 775of the file, those users in the file's group, anyone else.
776Every file has an independent set of access permissions for 776Every file has an independent set of access permissions for
777each of these classes. 777each of these classes.
778When an access check is made, the system decides if permission should be 778When an access check is made, the system decides if permission should be
779granted by checking the access information applicable to the caller. 779granted by checking the access information applicable to the caller.
780.Pp 780.Pp
781Read, write, and execute/search permissions on 781Read, write, and execute/search permissions on
782a file are granted to a process if: 782a file are granted to a process if:
783.Pp 783.Pp
784The process's effective user ID is that of the super-user. 784The process's effective user ID is that of the super-user.
785(Note: even the super-user cannot execute a non-executable file). 785(Note: even the super-user cannot execute a non-executable file).
786.Pp 786.Pp
787The process's effective user ID matches the user ID of the owner 787The process's effective user ID matches the user ID of the owner
788of the file and the owner permissions allow the access. 788of the file and the owner permissions allow the access.
789.Pp 789.Pp
790The process's effective user ID does not match the user ID of the 790The process's effective user ID does not match the user ID of the
791owner of the file, and either the process's effective 791owner of the file, and either the process's effective
792group ID matches the group ID 792group ID matches the group ID
793of the file, or the group ID of the file is in 793of the file, or the group ID of the file is in
794the process's group access list, 794the process's group access list,
795and the group permissions allow the access. 795and the group permissions allow the access.
796.Pp 796.Pp
797Neither the effective user ID nor effective group ID 797Neither the effective user ID nor effective group ID
798and group access list of the process 798and group access list of the process
799match the corresponding user ID and group ID of the file, 799match the corresponding user ID and group ID of the file,
800but the permissions for ``other users'' allow access. 800but the permissions for ``other users'' allow access.
801.Pp 801.Pp
802Otherwise, permission is denied. 802Otherwise, permission is denied.
803.It Sockets and Address Families 803.It Sockets and Address Families
804A socket is an endpoint for communication between processes. 804A socket is an endpoint for communication between processes.
805Each socket has queues for sending and receiving data. 805Each socket has queues for sending and receiving data.
806.Pp 806.Pp
807Sockets are typed according to their communications properties. 807Sockets are typed according to their communications properties.
808These properties include whether messages sent and received 808These properties include whether messages sent and received
809at a socket require the name of the partner, whether communication 809at a socket require the name of the partner, whether communication
810is reliable, the format used in naming message recipients, etc. 810is reliable, the format used in naming message recipients, etc.
811.Pp 811.Pp
812Each instance of the system supports some 812Each instance of the system supports some
813collection of socket types; consult 813collection of socket types; consult
814.Xr socket 2 814.Xr socket 2
815for more information about the types available and 815for more information about the types available and
816their properties. 816their properties.
817.Pp 817.Pp
818Each instance of the system supports some number of sets of 818Each instance of the system supports some number of sets of
819communications protocols. 819communications protocols.
820Each protocol set supports addresses of a certain format. 820Each protocol set supports addresses of a certain format.
821An Address Family is the set of addresses for a specific group of protocols. 821An Address Family is the set of addresses for a specific group of protocols.
822Each socket has an address 822Each socket has an address
823chosen from the address family in which the socket was created. 823chosen from the address family in which the socket was created.
824.El 824.El
825.Sh SEE ALSO 825.Sh SEE ALSO
826.Xr intro 3 , 826.Xr intro 3 ,
827.Xr perror 3 827.Xr perror 3
828.Sh HISTORY 828.Sh HISTORY
829An 829An
830.Nm intro 830.Nm intro
831manual page appeared in 831manual page appeared in
832.At v6 . 832.At v6 .