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