xref: /minix3/minix/man/man2/intro.2 (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc.\" Copyright (c) 1980, 1983, 1986, 1991, 1993
2*433d6423SLionel Sambuc.\"     The Regents of the University of California.
3*433d6423SLionel Sambuc.\" All rights reserved.  The Berkeley software License Agreement
4*433d6423SLionel Sambuc.\" specifies the terms and conditions for redistribution.
5*433d6423SLionel Sambuc.\"
6*433d6423SLionel Sambuc.\"	@(#)intro.2	8.5 (Berkeley) 2/27/95
7*433d6423SLionel Sambuc.\"
8*433d6423SLionel Sambuc.\" Adapted to MINIX 3
9*433d6423SLionel Sambuc.\"
10*433d6423SLionel Sambuc.Dd July 14, 2010
11*433d6423SLionel Sambuc.Dt INTRO 2
12*433d6423SLionel Sambuc.Os
13*433d6423SLionel Sambuc.Sh NAME
14*433d6423SLionel Sambuc.Nm intro ,
15*433d6423SLionel Sambuc.Nm errno
16*433d6423SLionel Sambuc.Nd introduction to system calls and error numbers
17*433d6423SLionel Sambuc.Sh SYNOPSIS
18*433d6423SLionel Sambuc.In errno.h
19*433d6423SLionel Sambuc.Sh DESCRIPTION
20*433d6423SLionel SambucThis section provides an overview of the system calls,
21*433d6423SLionel Sambuctheir error returns, and other common definitions and concepts.
22*433d6423SLionel Sambuc.Sh DIAGNOSTICS
23*433d6423SLionel SambucNearly all of the system calls provide an error number in the external
24*433d6423SLionel Sambucvariable
25*433d6423SLionel Sambuc.Va errno .
26*433d6423SLionel Sambuc.Pp
27*433d6423SLionel SambucWhen a system call detects an error,
28*433d6423SLionel Sambucit returns an integer value
29*433d6423SLionel Sambucindicating failure (usually \-1)
30*433d6423SLionel Sambucand sets the variable
31*433d6423SLionel Sambuc.Va errno
32*433d6423SLionel Sambucaccordingly.
33*433d6423SLionel Sambuc(This allows interpretation of the failure on receiving
34*433d6423SLionel Sambuca \-1 and to take action accordingly.)
35*433d6423SLionel SambucSuccessful calls never set
36*433d6423SLionel Sambuc.Va errno ;
37*433d6423SLionel Sambuconce set, it remains until another error occurs.
38*433d6423SLionel SambucIt should only be examined after an error has been reported, because
39*433d6423SLionel Sambucotherwise a leftover value from some previous error may be found
40*433d6423SLionel Sambucinstead.
41*433d6423SLionel Sambuc.Po
42*433d6423SLionel SambucMany library functions that are not system calls also set
43*433d6423SLionel Sambuc.Va errno
44*433d6423SLionel Sambucon return, in the same fashion.
45*433d6423SLionel SambucIn these cases a nonzero value may be left in
46*433d6423SLionel Sambuc.Va errno
47*433d6423SLionel Sambuceven upon successful return if some internal action failed.
48*433d6423SLionel Sambuc.Pc
49*433d6423SLionel Sambuc.Pp
50*433d6423SLionel SambucThe manual page for each system call will list some of the common
51*433d6423SLionel Sambucerrno codes that system call can return, but that should not be
52*433d6423SLionel Sambucconsidered an exhaustive list, i.e.
53*433d6423SLionel Sambuca properly written program should be able to gracefully recover from
54*433d6423SLionel Sambucany error that a system call might return.
55*433d6423SLionel SambucDocumenting all the error codes that a system call can return in
56*433d6423SLionel Sambuca more specification-like manner would take more resources than
57*433d6423SLionel Sambucthis project has available.
58*433d6423SLionel Sambuc.Pp
59*433d6423SLionel SambucNote also that a number of system calls overload the meanings of these
60*433d6423SLionel Sambucerror numbers, and that in these cases the meanings must be
61*433d6423SLionel Sambucinterpreted according to the type and circumstances of the call.
62*433d6423SLionel Sambuc.Pp
63*433d6423SLionel SambucThe following is a list of the errors and their
64*433d6423SLionel Sambucnames as given in
65*433d6423SLionel Sambuc.In errno.h .
66*433d6423SLionel Sambuc.Bl -hang -width Ds
67*433d6423SLionel Sambuc.It Er 0 OK Em "Error 0" .
68*433d6423SLionel SambucNot used.  (The symbol "OK" is only used inside the kernel source.)
69*433d6423SLionel Sambuc.It 1 EPERM Em "Operation not permitted" .
70*433d6423SLionel SambucAn attempt was made to perform an operation limited to processes
71*433d6423SLionel Sambucwith appropriate privileges or to the owner of a file or other
72*433d6423SLionel Sambucresources.
73*433d6423SLionel Sambuc.It Er 2 ENOENT Em "No such file or directory" .
74*433d6423SLionel SambucA component of a specified pathname did not exist, or the
75*433d6423SLionel Sambucpathname was an empty string.
76*433d6423SLionel Sambuc.It Er 3 ESRCH Em "No such process" .
77*433d6423SLionel SambucNo process could be found corresponding to that specified by the given
78*433d6423SLionel Sambucprocess ID.
79*433d6423SLionel SambucIt Er 4 EINTR Em "Interrupted function call" .
80*433d6423SLionel SambucAn asynchronous signal (such as
81*433d6423SLionel Sambuc.Dv SIGINT
82*433d6423SLionel Sambucor
83*433d6423SLionel Sambuc.Dv SIGQUIT )
84*433d6423SLionel Sambucwas caught by the process during the execution of an interruptible
85*433d6423SLionel Sambucfunction.
86*433d6423SLionel SambucIf the signal handler performs a normal return, the
87*433d6423SLionel Sambucinterrupted function call will seem to have returned the error condition.
88*433d6423SLionel Sambuc.It Er 5 EIO Em "Input/output error" .
89*433d6423SLionel SambucSome physical input or output error occurred.
90*433d6423SLionel SambucThis error will not be reported until a subsequent operation on the same file
91*433d6423SLionel Sambucdescriptor and may be lost (over written) by any subsequent errors.
92*433d6423SLionel Sambuc.It Er 6 ENXIO Em "Device not configured" .
93*433d6423SLionel SambucInput or output on a special file referred to a device that did not
94*433d6423SLionel Sambucexist, or
95*433d6423SLionel Sambucmade a request beyond the limits of the device.
96*433d6423SLionel SambucThis error may also occur when, for example,
97*433d6423SLionel Sambuca tape drive is not online or no disk pack is
98*433d6423SLionel Sambucloaded on a drive.
99*433d6423SLionel Sambuc.It Er 7 E2BIG Em "Arg list too long" .
100*433d6423SLionel SambucThe number of bytes used for the argument and environment
101*433d6423SLionel Sambuclist of the new process exceeded the current limit of
102*433d6423SLionel Sambuc262144 bytes
103*433d6423SLionel Sambuc.Pf ( Dv ARG_MAX
104*433d6423SLionel Sambucin
105*433d6423SLionel Sambuc.In limits.h ) .
106*433d6423SLionel Sambuc.It Er 8 ENOEXEC Em "Exec format error" .
107*433d6423SLionel SambucA request was made to execute a file
108*433d6423SLionel Sambucthat, although it has the appropriate permissions,
109*433d6423SLionel Sambucwas not in the format required for an
110*433d6423SLionel Sambucexecutable file.
111*433d6423SLionel Sambuc.It Er 9 EBADF Em "Bad file descriptor" .
112*433d6423SLionel SambucA file descriptor argument was out of range, referred to no open file,
113*433d6423SLionel Sambucor a
114*433d6423SLionel Sambuc.Xr read 2
115*433d6423SLionel Sambuc(or
116*433d6423SLionel Sambuc.Xr write 2 )
117*433d6423SLionel Sambucrequest was made to a file that was
118*433d6423SLionel Sambuconly open for writing (or reading).
119*433d6423SLionel Sambuc.It Er 10 ECHILD Em "\&No child processes" .
120*433d6423SLionel SambucA
121*433d6423SLionel Sambuc.Xr wait 2
122*433d6423SLionel Sambucor
123*433d6423SLionel Sambuc.Xr waitpid 2
124*433d6423SLionel Sambucfunction was executed by a process that had no existing or unwaited-for
125*433d6423SLionel Sambucchild processes.
126*433d6423SLionel Sambuc.It Er 11 EAGAIN Em "Resource temporarily unavailable" .
127*433d6423SLionel SambucThis is a temporary condition and later calls to the
128*433d6423SLionel Sambucsame routine may complete normally.
129*433d6423SLionel Sambuc.It Er 12 ENOMEM Em "Cannot allocate memory" .
130*433d6423SLionel SambucThe new process image required more memory than was allowed by the hardware
131*433d6423SLionel Sambucor by system-imposed memory management constraints.
132*433d6423SLionel SambucSoft limits may be increased to their corresponding hard limits.
133*433d6423SLionel Sambuc.It Er 13 EACCES Em "Permission denied" .
134*433d6423SLionel SambucAn attempt was made to access a file in a way forbidden
135*433d6423SLionel Sambucby its file access permissions.
136*433d6423SLionel Sambuc.It Er 14 EFAULT Em "Bad address" .
137*433d6423SLionel SambucThe system detected an invalid address in attempting to
138*433d6423SLionel Sambucuse an argument of a call.
139*433d6423SLionel SambucThe reliable detection of this error cannot be guaranteed and when not detected
140*433d6423SLionel Sambucmay result in the generation of a signal, indicating an address violation,
141*433d6423SLionel Sambucwhich is sent to the process.
142*433d6423SLionel Sambuc.It Er 15 ENOTBLK Em "Block device required" .
143*433d6423SLionel SambucA block device operation was attempted on a non-block device or file.
144*433d6423SLionel Sambuc.It Er 16 EBUSY Em "Resource busy" .
145*433d6423SLionel SambucAn attempt to use a system resource which was in use at the time
146*433d6423SLionel Sambucin a manner which would have conflicted with the request.
147*433d6423SLionel Sambuc.It Er 17 EEXIST Em "File exists" .
148*433d6423SLionel SambucAn existing file was mentioned in an inappropriate context,
149*433d6423SLionel Sambucfor instance, as the new link name in a
150*433d6423SLionel Sambuc.Xr link 2
151*433d6423SLionel Sambucfunction.
152*433d6423SLionel Sambuc.It Er 18 EXDEV Em "Improper link" .
153*433d6423SLionel SambucA hard link to a file on another file system
154*433d6423SLionel Sambucwas attempted.
155*433d6423SLionel Sambuc.It Er 19 ENODEV Em "Operation not supported by device" .
156*433d6423SLionel SambucAn attempt was made to apply an inappropriate
157*433d6423SLionel Sambucfunction to a device,
158*433d6423SLionel Sambucfor example,
159*433d6423SLionel Sambuctrying to read a write-only device such as a printer.
160*433d6423SLionel Sambuc.It Er 20 ENOTDIR Em "Not a directory" .
161*433d6423SLionel SambucA component of the specified pathname existed, but it was
162*433d6423SLionel Sambucnot a directory, when a directory was expected.
163*433d6423SLionel Sambuc.It Er 21 EISDIR Em "Is a directory" .
164*433d6423SLionel SambucAn attempt was made to open a directory with write mode specified.
165*433d6423SLionel Sambuc.It Er 22 EINVAL Em "Invalid argument" .
166*433d6423SLionel SambucSome invalid argument was supplied.
167*433d6423SLionel Sambuc(For example, specifying an undefined signal to a
168*433d6423SLionel Sambuc.Xr signal 3
169*433d6423SLionel Sambucor
170*433d6423SLionel Sambuc.Xr kill 2
171*433d6423SLionel Sambucfunction).
172*433d6423SLionel Sambuc.It Er 23 ENFILE Em "Too many open files in system" .
173*433d6423SLionel SambucMaximum number of file descriptors allowable on the system
174*433d6423SLionel Sambuchas been reached and a requests for an open cannot be satisfied
175*433d6423SLionel Sambucuntil at least one has been closed.
176*433d6423SLionel Sambuc.It Er 24 EMFILE Em "Too many open files" .
177*433d6423SLionel Sambuc\*[Lt]As released, the limit on the number of
178*433d6423SLionel Sambucopen files per process is 64.\*[Gt]
179*433d6423SLionel SambucThe
180*433d6423SLionel Sambuc.Xr getrlimit 2
181*433d6423SLionel Sambuccall with the
182*433d6423SLionel Sambuc.Ar RLIMIT_NOFILE
183*433d6423SLionel Sambucresource will obtain the current limit.
184*433d6423SLionel Sambuc.It Er 25 ENOTTY Em "Inappropriate ioctl for device" .
185*433d6423SLionel SambucA control function (see
186*433d6423SLionel Sambuc.Xr ioctl 2 )
187*433d6423SLionel Sambucwas attempted for a file or
188*433d6423SLionel Sambucspecial device for which the operation was inappropriate.
189*433d6423SLionel Sambuc.en 26 ETXTBSY "Text file busy
190*433d6423SLionel SambucAttempt to execute a program that is open for writing.  Obsolete under MINIX 3.
191*433d6423SLionel Sambuc.It Er 27 EFBIG Em "File too large" .
192*433d6423SLionel SambucThe size of a file exceeded the maximum.
193*433d6423SLionel Sambuc(The system-wide maximum file size is
194*433d6423SLionel Sambuc2147483648 (2GB) bytes.
195*433d6423SLionel SambucEach file system may impose a lower limit for files contained within it).
196*433d6423SLionel Sambuc.It Er 28 ENOSPC Em "Device out of space" .
197*433d6423SLionel SambucA
198*433d6423SLionel Sambuc.Xr write 2
199*433d6423SLionel Sambucto an ordinary file, the creation of a
200*433d6423SLionel Sambucdirectory or symbolic link, or the creation of a directory
201*433d6423SLionel Sambucentry failed because no more disk blocks were available
202*433d6423SLionel Sambucon the file system, or the allocation of an inode for a newly
203*433d6423SLionel Sambuccreated file failed because no more inodes were available
204*433d6423SLionel Sambucon the file system.
205*433d6423SLionel Sambuc.It Er 29 ESPIPE Em "Illegal seek" .
206*433d6423SLionel SambucAn
207*433d6423SLionel Sambuc.Xr lseek 2
208*433d6423SLionel Sambucfunction was issued on a socket, pipe or
209*433d6423SLionel Sambuc.Tn FIFO .
210*433d6423SLionel Sambuc.It Er 30 EROFS Em "Read-only file system" .
211*433d6423SLionel SambucAn attempt was made to modify a file or directory
212*433d6423SLionel Sambucwas made
213*433d6423SLionel Sambucon a file system that was read-only at the time.
214*433d6423SLionel Sambuc.It Er 31 EMLINK Em "Too many links" .
215*433d6423SLionel SambucThe number of hard links to a single file has exceeded the maximum.
216*433d6423SLionel Sambuc(The system-wide maximum number of hard links is 32767.
217*433d6423SLionel SambucEach file system may impose a lower limit for files contained within it).
218*433d6423SLionel Sambuc.It Er 32 EPIPE Em "Broken pipe" .
219*433d6423SLionel SambucA write on a pipe, socket or
220*433d6423SLionel Sambuc.Tn FIFO
221*433d6423SLionel Sambucfor which there is no process
222*433d6423SLionel Sambucto read the data.
223*433d6423SLionel Sambuc.It Er 33 EDOM Em "Numerical argument out of domain" .
224*433d6423SLionel SambucA numerical input argument was outside the defined domain of the mathematical
225*433d6423SLionel Sambucfunction.
226*433d6423SLionel Sambuc.It Er 34 ERANGE Em "Result too large or too small" .
227*433d6423SLionel SambucThe result of the function is too large or too small to be represented
228*433d6423SLionel Sambucin the available space.
229*433d6423SLionel Sambuc.It Er 35 EDEADLK Em "Resource deadlock avoided" .
230*433d6423SLionel SambucAn attempt was made to lock a system resource that
231*433d6423SLionel Sambucwould have resulted in a deadlock situation.
232*433d6423SLionel Sambuc.It Er 36 ENAMETOOLONG Em "File name too long" .
233*433d6423SLionel SambucA component of a path name exceeded
234*433d6423SLionel Sambuc.Pq Dv NAME_MAX
235*433d6423SLionel Sambuccharacters, or an entire
236*433d6423SLionel Sambucpath name exceeded 255
237*433d6423SLionel Sambuc.Pq Dv PATH_MAX
238*433d6423SLionel Sambuccharacters.
239*433d6423SLionel Sambuc.It Er 37 ENOLCK Em "No locks available" .
240*433d6423SLionel SambucA system-imposed limit on the number of simultaneous file
241*433d6423SLionel Sambuclocks was reached.
242*433d6423SLionel Sambuc.It Er 38 ENOSYS Em "Function not implemented" .
243*433d6423SLionel SambucAttempted a system call that is not available on this
244*433d6423SLionel Sambucsystem.
245*433d6423SLionel Sambuc.It Er 39 ENOTEMPTY Em "Directory not empty" .
246*433d6423SLionel SambucA directory with entries other than
247*433d6423SLionel Sambuc.Ql \&.
248*433d6423SLionel Sambucand
249*433d6423SLionel Sambuc.Ql \&..
250*433d6423SLionel Sambucwas supplied to a remove directory or rename call.
251*433d6423SLionel Sambuc.It Er 40 ELOOP Em "Too many levels of symbolic links" .
252*433d6423SLionel SambucA path name lookup involved more than 16
253*433d6423SLionel Sambuc.Pq Dv SYMLOOP_MAX
254*433d6423SLionel Sambucsymbolic links.
255*433d6423SLionel Sambuc.It Er 41 ERESTART Em "Service restarted" .
256*433d6423SLionel Sambuc.It Er 43 ERESTART Em "Identifier removed" .
257*433d6423SLionel SambucAn IPC identifier was removed while the current process was waiting on it.
258*433d6423SLionel Sambuc.It Er 44 EILSEQ Em "Illegal byte sequence" .
259*433d6423SLionel SambucA wide character/multibyte character encoding error occurred.
260*433d6423SLionel Sambuc.It Er 45 EFTYPE Em "Inappropriate file type or format" .
261*433d6423SLionel SambucAttempted a file operation on a file of a type for which it was invalid.
262*433d6423SLionel Sambuc.It Er 46 EOVERFLOW Em "Value too large to be stored in data type" .
263*433d6423SLionel SambucA numerical result of the function was too large to be stored in the
264*433d6423SLionel Sambuccaller-provided space.
265*433d6423SLionel Sambuc.It Er 50 EPACKSIZE Em "Invalid packet size" .
266*433d6423SLionel Sambuc.It Er 51 ENOBUFS Em "\&No buffer space available" .
267*433d6423SLionel SambucAn operation on a socket or pipe was not performed because
268*433d6423SLionel Sambucthe system lacked sufficient buffer space or because a queue was full.
269*433d6423SLionel Sambuc.It Er 53 EBADMODE Em "Bad mode in ioctl" .
270*433d6423SLionel Sambuc.It Er 54 EWOULDBLOCK Em "Would block" .
271*433d6423SLionel Sambuc.It Er 55 ENETUNREACH Em "Network is unreachable" .
272*433d6423SLionel SambucA socket operation was attempted to an unreachable network.
273*433d6423SLionel Sambuc.It Er 56 EHOSTUNREACH Em "No route to host" .
274*433d6423SLionel SambucA socket operation was attempted to an unreachable host.
275*433d6423SLionel Sambuc.It Er 57 EISCONN Em "Socket is already connected" .
276*433d6423SLionel SambucA
277*433d6423SLionel Sambuc.Xr connect 2
278*433d6423SLionel Sambucrequest was made on an already connected socket; or,
279*433d6423SLionel Sambuca
280*433d6423SLionel Sambuc.Xr sendto 2
281*433d6423SLionel Sambucor
282*433d6423SLionel Sambuc.Xr sendmsg 2
283*433d6423SLionel Sambucrequest on a connected socket specified a destination
284*433d6423SLionel Sambucwhen already connected.
285*433d6423SLionel Sambuc.It Er 58 EADDRINUSE Em "Address already in use" .
286*433d6423SLionel SambucOnly one usage of each address is normally permitted.
287*433d6423SLionel Sambuc.It Er 59 ECONNREFUSED Em "Connection refused" .
288*433d6423SLionel SambucNo connection could be made because the target machine actively
289*433d6423SLionel Sambucrefused it.
290*433d6423SLionel SambucThis usually results from trying to connect
291*433d6423SLionel Sambucto a service that is inactive on the foreign host.
292*433d6423SLionel Sambuc.It Er 60 ECONNRESET Em "Connection reset by peer" .
293*433d6423SLionel SambucA connection was forcibly closed by a peer.
294*433d6423SLionel SambucThis normally results from a loss of the connection on the remote
295*433d6423SLionel Sambucsocket due to a timeout or a reboot.
296*433d6423SLionel Sambuc.It Er 61 ETIMEDOUT Em "Operation timed out" .
297*433d6423SLionel SambucA
298*433d6423SLionel Sambuc.Xr connect 2
299*433d6423SLionel Sambucor
300*433d6423SLionel Sambuc.Xr send 2
301*433d6423SLionel Sambucrequest failed because the connected party did not
302*433d6423SLionel Sambucproperly respond after a period of time.
303*433d6423SLionel Sambuc(The timeout period is dependent on the communication protocol).
304*433d6423SLionel Sambuc.It Er 62 EURG Em "Urgent data present" .
305*433d6423SLionel Sambuc.It Er 63 ENOURG Em "No urgent data present" .
306*433d6423SLionel Sambuc.It Er 64 ENOTCONN Em "Socket is not connected" .
307*433d6423SLionel SambucAn request to send or receive data was disallowed because
308*433d6423SLionel Sambucthe socket was not connected and (when sending on a datagram socket)
309*433d6423SLionel Sambucno address was supplied.
310*433d6423SLionel Sambuc.It Er 65 ESHUTDOWN Em "Cannot send after socket shutdown" .
311*433d6423SLionel SambucA request to send data was disallowed because the socket
312*433d6423SLionel Sambuchad already been shut down with a previous
313*433d6423SLionel Sambuc.Xr shutdown 2
314*433d6423SLionel Sambuccall.
315*433d6423SLionel Sambuc.It Er 66 ENOCONN Em "No such connection" .
316*433d6423SLionel Sambuc.It Er 67 EAFNOSUPPORT Em "Address family not supported by protocol family" .
317*433d6423SLionel SambucAn address incompatible with the requested protocol was used.
318*433d6423SLionel SambucFor example, you shouldn't necessarily expect to be able to use
319*433d6423SLionel Sambuc.Tn NS
320*433d6423SLionel Sambucaddresses with
321*433d6423SLionel Sambuc.Tn ARPA
322*433d6423SLionel SambucInternet protocols.
323*433d6423SLionel Sambuc.It Er 68 EPROTONOSUPPORT Em "Protocol not supported" .
324*433d6423SLionel SambucThe protocol has not been configured into the
325*433d6423SLionel Sambucsystem or no implementation for it exists.
326*433d6423SLionel Sambuc.It Er 69 EPROTOTYPE Em "Protocol wrong type for socket" .
327*433d6423SLionel SambucA protocol was specified that does not support the semantics of the
328*433d6423SLionel Sambucsocket type requested.
329*433d6423SLionel SambucFor example, you cannot use the
330*433d6423SLionel Sambuc.Tn ARPA
331*433d6423SLionel SambucInternet
332*433d6423SLionel Sambuc.Tn UDP
333*433d6423SLionel Sambucprotocol with type
334*433d6423SLionel Sambuc.Dv SOCK_STREAM .
335*433d6423SLionel Sambuc.It Er 70 EINPROGRESS Em "Operation now in progress" .
336*433d6423SLionel SambucAn operation that takes a long time to complete (such as
337*433d6423SLionel Sambuca
338*433d6423SLionel Sambuc.Xr connect 2 )
339*433d6423SLionel Sambucwas attempted on a non-blocking object (see
340*433d6423SLionel Sambuc.Xr fcntl 2 ) .
341*433d6423SLionel Sambuc.It Er 71 EADDRNOTAVAIL Em "Cannot assign requested address" .
342*433d6423SLionel SambucNormally results from an attempt to create a socket with an
343*433d6423SLionel Sambucaddress not on this machine.
344*433d6423SLionel Sambuc.It Er 72 EALREADY Em "Operation already in progress" .
345*433d6423SLionel SambucAn operation was attempted on a non-blocking object that already
346*433d6423SLionel Sambuchad an operation in progress.
347*433d6423SLionel Sambuc.It Er 73 EMSGSIZE Em "Message too long" .
348*433d6423SLionel SambucA message sent on a socket was larger than the internal message buffer
349*433d6423SLionel Sambucor some other network limit.
350*433d6423SLionel Sambuc.It Er 74 ENOTSOCK Em "Socket operation on non-socket" .
351*433d6423SLionel SambucSelf-explanatory.
352*433d6423SLionel Sambuc.It Er 75 ENOPROTOOPT Em "Protocol option not available" .
353*433d6423SLionel SambucA bad option or level was specified in a
354*433d6423SLionel Sambuc.Xr getsockopt 2
355*433d6423SLionel Sambucor
356*433d6423SLionel Sambuc.Xr setsockopt 2
357*433d6423SLionel Sambuccall.
358*433d6423SLionel Sambuc.It Er 76 EOPNOTSUPP Em "Operation not supported" (has alias ENOTSUP) .
359*433d6423SLionel SambucThe attempted operation is not supported for the type of object referenced.
360*433d6423SLionel SambucUsually this occurs when a file descriptor refers to a file or socket
361*433d6423SLionel Sambucthat cannot support this operation,
362*433d6423SLionel Sambucfor example, trying to
363*433d6423SLionel Sambuc.Em accept
364*433d6423SLionel Sambuca connection on a datagram socket.
365*433d6423SLionel Sambuc.It Er 77 ENETDOWN Em "Network is down" .
366*433d6423SLionel SambucA socket operation encountered a dead network.
367*433d6423SLionel Sambuc.It Er 78 EPFNOSUPPORT Em "Protocol family not supported" .
368*433d6423SLionel SambucA socket operation specified an unsupported protocol family.
369*433d6423SLionel Sambuc.It Er 79 EDESTADDRREQ Em "Destination address required" .
370*433d6423SLionel SambucA required address was omitted from an operation on a socket.
371*433d6423SLionel Sambuc.It Er 80 EHOSTDOWN Em "Host is down" .
372*433d6423SLionel SambucThe destination host has been determined to be down or disconnected.
373*433d6423SLionel Sambuc.El
374*433d6423SLionel Sambuc.Sh DEFINITIONS
375*433d6423SLionel Sambuc.Bl -tag -width Ds
376*433d6423SLionel Sambuc.It Process ID
377*433d6423SLionel SambucEach active process in the system is uniquely identified by a positive
378*433d6423SLionel Sambucinteger called a process ID.  The range of this ID is from 1 to 29999.
379*433d6423SLionel Sambuc.It Parent process ID
380*433d6423SLionel SambucA new process is created by a currently active process; (see
381*433d6423SLionel Sambuc.Xr fork 2 ) .
382*433d6423SLionel SambucThe parent process ID of a process is initially the process ID of its creator.
383*433d6423SLionel SambucIf the creating process exits,
384*433d6423SLionel Sambucthe parent process ID of each child is set to the ID of
385*433d6423SLionel Sambuc.Em init ,
386*433d6423SLionel Sambuc.Xr init 8 .
387*433d6423SLionel Sambuc.It Process Group
388*433d6423SLionel SambucEach active process is a member of a process group that is identified by
389*433d6423SLionel Sambuca positive integer called the process group ID.
390*433d6423SLionel SambucThis is the process ID of the group leader.
391*433d6423SLionel SambucThis grouping permits the signaling of related processes (see
392*433d6423SLionel Sambuc.Xr termios 4 ).
393*433d6423SLionel Sambuc.It Session
394*433d6423SLionel SambucA session is a set of one or more process groups.
395*433d6423SLionel SambucA session is created by a successful call to
396*433d6423SLionel Sambuc.Xr setsid 2 ,
397*433d6423SLionel Sambucwhich causes the caller to become the only member of the only process
398*433d6423SLionel Sambucgroup in the new session.
399*433d6423SLionel Sambuc.It Session leader
400*433d6423SLionel SambucA process that has created a new session by a successful call to
401*433d6423SLionel Sambuc.Xr setsid 2 ,
402*433d6423SLionel Sambucis known as a session leader.
403*433d6423SLionel SambucOnly a session leader may acquire a terminal as its controlling terminal (see
404*433d6423SLionel Sambuc.Xr termios 4 ) .
405*433d6423SLionel Sambuc.It Controlling process
406*433d6423SLionel SambucA session leader with a controlling terminal is a controlling process.
407*433d6423SLionel Sambuc.It Controlling terminal
408*433d6423SLionel SambucA terminal that is associated with a session is known as the controlling
409*433d6423SLionel Sambucterminal for that session and its members.
410*433d6423SLionel Sambuc.It "Real User ID and Real Group ID"
411*433d6423SLionel SambucEach user on the system is identified by a positive integer
412*433d6423SLionel Sambuctermed the real user ID.
413*433d6423SLionel Sambuc.Pp
414*433d6423SLionel SambucEach user is also a member of one or more groups.
415*433d6423SLionel SambucOne of these groups is distinguished from others and
416*433d6423SLionel Sambucused in implementing accounting facilities.
417*433d6423SLionel SambucThe positive integer corresponding to this distinguished group is
418*433d6423SLionel Sambuctermed the real group ID.
419*433d6423SLionel Sambuc.Pp
420*433d6423SLionel SambucAll processes have a real user ID and real group ID.
421*433d6423SLionel SambucThese are initialized from the equivalent attributes
422*433d6423SLionel Sambucof the process that created it.
423*433d6423SLionel Sambuc.It "Effective User Id, Effective Group Id, and Group Access List"
424*433d6423SLionel SambucAccess to system resources is governed by two values:
425*433d6423SLionel Sambucthe effective user ID and the group access list.
426*433d6423SLionel Sambuc(In POSIX.1, the group access list is known as the set of supplementary
427*433d6423SLionel Sambucgroup IDs, and it is unspecified whether the effective group ID is
428*433d6423SLionel Sambuca member of the list.)
429*433d6423SLionel Sambuc.Pp
430*433d6423SLionel SambucThe effective user ID and effective group ID are initially the
431*433d6423SLionel Sambucprocess's real user ID and real group ID respectively.  Either
432*433d6423SLionel Sambucmay be modified through execution of a set-user-ID or set-group-ID
433*433d6423SLionel Sambucfile (possibly by one its ancestors) (see
434*433d6423SLionel Sambuc.BR execve (2)).
435*433d6423SLionel Sambuc.Pp
436*433d6423SLionel SambucThe group access list is an additional set of group ID's
437*433d6423SLionel Sambucused only in determining resource accessibility.
438*433d6423SLionel SambucAccess checks are performed as described below in
439*433d6423SLionel Sambuc.Qq File Access Permissions .
440*433d6423SLionel SambucIt Super-user
441*433d6423SLionel SambucA process is recognized as a
442*433d6423SLionel Sambuc.Em super-user
443*433d6423SLionel Sambucprocess and is granted special privileges if its effective user ID is 0.
444*433d6423SLionel Sambuc.It Descriptor
445*433d6423SLionel SambucAn integer assigned by the system when a file is referenced
446*433d6423SLionel Sambucby
447*433d6423SLionel Sambuc.Xr open 2
448*433d6423SLionel Sambucor
449*433d6423SLionel Sambuc.Xr dup 2 ,
450*433d6423SLionel Sambucor when a socket is created by
451*433d6423SLionel Sambuc.Xr pipe 2 ,
452*433d6423SLionel Sambuc.Xr socket 2 ,
453*433d6423SLionel Sambucor
454*433d6423SLionel Sambuc.Xr socketpair 2 ,
455*433d6423SLionel Sambucwhich uniquely identifies an access path to that file or socket from
456*433d6423SLionel Sambuca given process or any of its children.
457*433d6423SLionel Sambuc.It File Name
458*433d6423SLionel SambucNames consisting of up to 60
459*433d6423SLionel Sambuc.Pq Dv NAME_MAX
460*433d6423SLionel Sambuccharacters may be used to name
461*433d6423SLionel Sambucan ordinary file, special file, or directory.
462*433d6423SLionel Sambuc.Pp
463*433d6423SLionel SambucThese characters may be selected from the set of all
464*433d6423SLionel Sambuc.Tn ASCII
465*433d6423SLionel Sambuccharacter
466*433d6423SLionel Sambucexcluding 0 (NUL) and the
467*433d6423SLionel Sambuc.Tn ASCII
468*433d6423SLionel Sambuccode for
469*433d6423SLionel Sambuc.Ql \&/
470*433d6423SLionel Sambuc(slash).
471*433d6423SLionel Sambuc(The parity bit, bit 7, must be 0).
472*433d6423SLionel Sambuc.Pp
473*433d6423SLionel SambucNote that it is generally unwise to use
474*433d6423SLionel Sambuc.Ql \&* ,
475*433d6423SLionel Sambuc.Ql \&? ,
476*433d6423SLionel Sambuc.Ql \&[
477*433d6423SLionel Sambucor
478*433d6423SLionel Sambuc.Ql \&]
479*433d6423SLionel Sambucas part of
480*433d6423SLionel Sambucfile names because of the special meaning attached to these characters
481*433d6423SLionel Sambucby the shell.
482*433d6423SLionel Sambuc.It Pathname
483*433d6423SLionel SambucA path name is a
484*433d6423SLionel Sambuc.Tn NUL Ns -terminated
485*433d6423SLionel Sambuccharacter string starting with an
486*433d6423SLionel Sambucoptional slash
487*433d6423SLionel Sambuc.Ql \&/ ,
488*433d6423SLionel Sambucfollowed by zero or more directory names separated
489*433d6423SLionel Sambucby slashes, optionally followed by a file name.
490*433d6423SLionel SambucThe total length of a path name must be less than 255
491*433d6423SLionel Sambuc.Pq Dv PATH_MAX
492*433d6423SLionel Sambuccharacters.
493*433d6423SLionel Sambuc.Pp
494*433d6423SLionel SambucIf a path name begins with a slash, the path search begins at the
495*433d6423SLionel Sambuc.Em root
496*433d6423SLionel Sambucdirectory.
497*433d6423SLionel SambucOtherwise, the search begins from the current working directory.
498*433d6423SLionel SambucA slash by itself names the root directory.
499*433d6423SLionel SambucAn empty string is not a valid pathname.
500*433d6423SLionel Sambuc.It Directory
501*433d6423SLionel SambucA directory is a special type of file that contains entries
502*433d6423SLionel Sambucthat are references to other files.
503*433d6423SLionel SambucDirectory entries are called links.
504*433d6423SLionel SambucBy convention, a directory contains at least two links,
505*433d6423SLionel Sambuc.Ql \&.
506*433d6423SLionel Sambucand
507*433d6423SLionel Sambuc.Ql \&.. ,
508*433d6423SLionel Sambucreferred to as
509*433d6423SLionel Sambuc.Em dot
510*433d6423SLionel Sambucand
511*433d6423SLionel Sambuc.Em dot-dot
512*433d6423SLionel Sambucrespectively.
513*433d6423SLionel SambucDot refers to the directory itself and dot-dot refers to its parent directory.
514*433d6423SLionel Sambuc.It "Root Directory and Current Working Directory"
515*433d6423SLionel SambucEach process has associated with it a concept of a root directory
516*433d6423SLionel Sambucand a current working directory for the purpose of resolving path
517*433d6423SLionel Sambucname searches.
518*433d6423SLionel SambucA process's root directory need not be the root
519*433d6423SLionel Sambucdirectory of the root file system.
520*433d6423SLionel Sambuc.It File Access Permissions
521*433d6423SLionel SambucEvery file in the file system has a set of access permissions.
522*433d6423SLionel SambucThese permissions are used in determining whether a process
523*433d6423SLionel Sambucmay perform a requested operation on the file (such as opening
524*433d6423SLionel Sambuca file for writing).
525*433d6423SLionel SambucAccess permissions are established at the time a file is created.
526*433d6423SLionel SambucThey may be changed at some later time through the
527*433d6423SLionel Sambuc.Xr chmod 2
528*433d6423SLionel Sambuccall.
529*433d6423SLionel Sambuc.Pp
530*433d6423SLionel SambucFile access is broken down according to whether a file may be: read,
531*433d6423SLionel Sambucwritten, or executed.
532*433d6423SLionel SambucDirectory files use the execute permission to control if the
533*433d6423SLionel Sambucdirectory may be searched.
534*433d6423SLionel Sambuc.Pp
535*433d6423SLionel SambucFile access permissions are interpreted by the system as
536*433d6423SLionel Sambucthey apply to three different classes of users: the owner
537*433d6423SLionel Sambucof the file, those users in the file's group, anyone else.
538*433d6423SLionel SambucEvery file has an independent set of access permissions for
539*433d6423SLionel Sambuceach of these classes.
540*433d6423SLionel SambucWhen an access check is made, the system decides if permission should be
541*433d6423SLionel Sambucgranted by checking the access information applicable to the caller.
542*433d6423SLionel Sambuc.Pp
543*433d6423SLionel SambucRead, write, and execute/search permissions on
544*433d6423SLionel Sambuca file are granted to a process if:
545*433d6423SLionel Sambuc.Pp
546*433d6423SLionel SambucThe process's effective user ID is that of the super-user.
547*433d6423SLionel Sambuc(Note: even the super-user cannot execute a non-executable file).
548*433d6423SLionel Sambuc.Pp
549*433d6423SLionel SambucThe process's effective user ID matches the user ID of the owner
550*433d6423SLionel Sambucof the file and the owner permissions allow the access.
551*433d6423SLionel Sambuc.Pp
552*433d6423SLionel SambucThe process's effective user ID does not match the user ID of the
553*433d6423SLionel Sambucowner of the file, and either the process's effective
554*433d6423SLionel Sambucgroup ID matches the group ID
555*433d6423SLionel Sambucof the file, or the group ID of the file is in
556*433d6423SLionel Sambucthe process's group access list,
557*433d6423SLionel Sambucand the group permissions allow the access.
558*433d6423SLionel Sambuc.Pp
559*433d6423SLionel SambucNeither the effective user ID nor effective group ID
560*433d6423SLionel Sambucand group access list of the process
561*433d6423SLionel Sambucmatch the corresponding user ID and group ID of the file,
562*433d6423SLionel Sambucbut the permissions for ``other users'' allow access.
563*433d6423SLionel Sambuc.Pp
564*433d6423SLionel SambucOtherwise, permission is denied.
565*433d6423SLionel Sambuc.It Sockets and Address Families
566*433d6423SLionel SambucA socket is an endpoint for communication between processes.
567*433d6423SLionel SambucEach socket has queues for sending and receiving data.
568*433d6423SLionel Sambuc.Pp
569*433d6423SLionel SambucSockets are typed according to their communications properties.
570*433d6423SLionel SambucThese properties include whether messages sent and received
571*433d6423SLionel Sambucat a socket require the name of the partner, whether communication
572*433d6423SLionel Sambucis reliable, the format used in naming message recipients, etc.
573*433d6423SLionel Sambuc.Pp
574*433d6423SLionel SambucEach instance of the system supports some
575*433d6423SLionel Sambuccollection of socket types; consult
576*433d6423SLionel Sambuc.Xr socket 2
577*433d6423SLionel Sambucfor more information about the types available and
578*433d6423SLionel Sambuctheir properties.
579*433d6423SLionel Sambuc.Pp
580*433d6423SLionel SambucEach instance of the system supports some number of sets of
581*433d6423SLionel Sambuccommunications protocols.
582*433d6423SLionel SambucEach protocol set supports addresses of a certain format.
583*433d6423SLionel SambucAn Address Family is the set of addresses for a specific group of protocols.
584*433d6423SLionel SambucEach socket has an address
585*433d6423SLionel Sambucchosen from the address family in which the socket was created.
586*433d6423SLionel Sambuc.El
587*433d6423SLionel Sambuc.Sh SEE ALSO
588*433d6423SLionel Sambuc.Xr intro 3 ,
589*433d6423SLionel Sambuc.Xr perror 3
590*433d6423SLionel Sambuc
591*433d6423SLionel Sambuc
592