xref: /freebsd/lib/libsys/intro.2 (revision 9a62cdc0132720c439313707b5e339dc348b0d45)
19e8df790SAlexander Ziaee.\"-
29e8df790SAlexander Ziaee.\" SPDX-License-Identifier: BSD-3-Clause
39e8df790SAlexander Ziaee.\"
48269e767SBrooks Davis.\" Copyright (c) 1980, 1983, 1986, 1991, 1993
58269e767SBrooks Davis.\"	The Regents of the University of California.  All rights reserved.
68269e767SBrooks Davis.\"
78269e767SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
88269e767SBrooks Davis.\" modification, are permitted provided that the following conditions
98269e767SBrooks Davis.\" are met:
108269e767SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
118269e767SBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
128269e767SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
138269e767SBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
148269e767SBrooks Davis.\"    documentation and/or other materials provided with the distribution.
158269e767SBrooks Davis.\" 3. Neither the name of the University nor the names of its contributors
168269e767SBrooks Davis.\"    may be used to endorse or promote products derived from this software
178269e767SBrooks Davis.\"    without specific prior written permission.
188269e767SBrooks Davis.\"
198269e767SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
208269e767SBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
218269e767SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
228269e767SBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
238269e767SBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
248269e767SBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
258269e767SBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
268269e767SBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
278269e767SBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
288269e767SBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
298269e767SBrooks Davis.\" SUCH DAMAGE.
308269e767SBrooks Davis.\"
31bcc57e97SAlexander Ziaee.Dd April 19, 2024
328269e767SBrooks Davis.Dt INTRO 2
338269e767SBrooks Davis.Os
348269e767SBrooks Davis.Sh NAME
35*9a62cdc0SAlexander Ziaee.Nm intro ,
36*9a62cdc0SAlexander Ziaee.Nm errno
37*9a62cdc0SAlexander Ziaee.Nd introduction to system calls and their error numbers
388269e767SBrooks Davis.Sh LIBRARY
398269e767SBrooks Davis.Lb libc
408269e767SBrooks Davis.Sh SYNOPSIS
4169ff2d75SAlexander Ziaee.In sys/syscall.h
428269e767SBrooks Davis.In errno.h
438269e767SBrooks Davis.Sh DESCRIPTION
44de525c50SAlexander ZiaeeThis section contains the system calls which comprise the
45de525c50SAlexander Ziaee.Fx
46de525c50SAlexander Ziaeeprogramming environment.
47de525c50SAlexander ZiaeeThis page also provides an overview of common definitions and concepts
48de525c50SAlexander Ziaeerelevant to system calls, where to find a table of the system calls
49de525c50SAlexander Ziaeecurrently available on your system, and their error returns.
508269e767SBrooks Davis.\".Pp
518269e767SBrooks Davis.\".Sy System call restart
528269e767SBrooks Davis.\".Pp
538269e767SBrooks Davis.\"(more later...)
54d846f33bSAlexander Ziaee.Sh DEFINITIONS
55d846f33bSAlexander Ziaee.Bl -tag -width Ds
56d846f33bSAlexander Ziaee.It Process ID
57d846f33bSAlexander ZiaeeEach active process in the system is uniquely identified by a non-negative
58d846f33bSAlexander Ziaeeinteger called a process ID.
59d846f33bSAlexander ZiaeeThe range of this ID is from 0 to 99999.
60d846f33bSAlexander Ziaee.It Parent process ID
61d846f33bSAlexander ZiaeeA new process is created by a currently active process
62d846f33bSAlexander Ziaee.Pq see Xr fork 2 .
63d846f33bSAlexander ZiaeeThe parent process ID of a process is initially the process ID of its creator.
64d846f33bSAlexander ZiaeeIf the creating process exits,
65d846f33bSAlexander Ziaeethe parent process ID of each child is set to the ID of the calling process's
66d846f33bSAlexander Ziaeereaper
67d846f33bSAlexander Ziaee.Pq see Xr procctl 2 ,
68d846f33bSAlexander Ziaeenormally
69d846f33bSAlexander Ziaee.Xr init 8 .
70d846f33bSAlexander Ziaee.It Process Group
71d846f33bSAlexander ZiaeeEach active process is a member of a process group that is identified by
72d846f33bSAlexander Ziaeea non-negative integer called the process group ID.
73d846f33bSAlexander ZiaeeThis is the process
74d846f33bSAlexander ZiaeeID of the group leader.
75d846f33bSAlexander ZiaeeThis grouping permits the signaling of related processes
76d846f33bSAlexander Ziaee.Pq see Xr termios 4
77d846f33bSAlexander Ziaeeand the job control mechanisms of
78d846f33bSAlexander Ziaee.Xr csh 1 .
79d846f33bSAlexander Ziaee.It Session
80d846f33bSAlexander ZiaeeA session is a set of one or more process groups.
81d846f33bSAlexander ZiaeeA session is created by a successful call to
82d846f33bSAlexander Ziaee.Xr setsid 2 ,
83d846f33bSAlexander Ziaeewhich causes the caller to become the only member of the only process
84d846f33bSAlexander Ziaeegroup in the new session.
85d846f33bSAlexander Ziaee.It Session leader
86d846f33bSAlexander ZiaeeA process that has created a new session by a successful call to
87d846f33bSAlexander Ziaee.Xr setsid 2 ,
88d846f33bSAlexander Ziaeeis known as a session leader.
89d846f33bSAlexander ZiaeeOnly a session leader may acquire a terminal as its controlling terminal
90d846f33bSAlexander Ziaee.Pq see Xr termios 4 .
91d846f33bSAlexander Ziaee.It Controlling process
92d846f33bSAlexander ZiaeeA session leader with a controlling terminal is a controlling process.
93d846f33bSAlexander Ziaee.It Controlling terminal
94d846f33bSAlexander ZiaeeA terminal that is associated with a session is known as the controlling
95d846f33bSAlexander Ziaeeterminal for that session and its members.
96d846f33bSAlexander Ziaee.It Terminal Process Group ID
97d846f33bSAlexander ZiaeeA terminal may be acquired by a session leader as its controlling terminal.
98d846f33bSAlexander ZiaeeOnce a terminal is associated with a session, any of the process groups
99d846f33bSAlexander Ziaeewithin the session may be placed into the foreground by setting
100d846f33bSAlexander Ziaeethe terminal process group ID to the ID of the process group.
101d846f33bSAlexander ZiaeeThis facility is used
102d846f33bSAlexander Ziaeeto arbitrate between multiple jobs contending for the same terminal
103d846f33bSAlexander Ziaee.Pq see Xr csh 1 and Xr tty 4 .
104d846f33bSAlexander Ziaee.It Orphaned Process Group
105d846f33bSAlexander ZiaeeA process group is considered to be
106d846f33bSAlexander Ziaee.Em orphaned
107d846f33bSAlexander Ziaeeif it is not under the control of a job control shell.
108d846f33bSAlexander ZiaeeMore precisely, a process group is orphaned
109d846f33bSAlexander Ziaeewhen none of its members has a parent process that is in the same session
110d846f33bSAlexander Ziaeeas the group,
111d846f33bSAlexander Ziaeebut is in a different process group.
112d846f33bSAlexander ZiaeeNote that when a process exits, the parent process for its children
113d846f33bSAlexander Ziaeeis normally changed to be
114d846f33bSAlexander Ziaee.Xr init 8 ,
115d846f33bSAlexander Ziaeewhich is in a separate session.
116d846f33bSAlexander ZiaeeNot all members of an orphaned process group are necessarily orphaned
117d846f33bSAlexander Ziaeeprocesses
118d846f33bSAlexander Ziaee.Pq those whose creating process has exited .
119d846f33bSAlexander ZiaeeThe process group of a session leader is orphaned by definition.
120d846f33bSAlexander Ziaee.It Real User ID and Real Group ID
121d846f33bSAlexander ZiaeeEach user on the system is identified by a positive integer
122d846f33bSAlexander Ziaeetermed the real user ID.
123d846f33bSAlexander Ziaee.Pp
124d846f33bSAlexander ZiaeeEach user is also a member of one or more groups.
125d846f33bSAlexander ZiaeeOne of these groups is distinguished from others and
126d846f33bSAlexander Ziaeeused in implementing accounting facilities.
127d846f33bSAlexander ZiaeeThe positive
128d846f33bSAlexander Ziaeeinteger corresponding to this distinguished group is termed
129d846f33bSAlexander Ziaeethe real group ID.
130d846f33bSAlexander Ziaee.Pp
131d846f33bSAlexander ZiaeeAll processes have a real user ID and real group ID.
132d846f33bSAlexander ZiaeeThese are initialized from the equivalent attributes
133d846f33bSAlexander Ziaeeof the process that created it.
134d846f33bSAlexander Ziaee.It Effective User Id, Effective Group Id, and Group Access List
135d846f33bSAlexander ZiaeeAccess to system resources is governed by two values:
136d846f33bSAlexander Ziaeethe effective user ID, and the group access list.
137d846f33bSAlexander ZiaeeThe first member of the group access list is also known as the
138d846f33bSAlexander Ziaeeeffective group ID.
139d846f33bSAlexander ZiaeeIn POSIX.1, the group access list is known as the set of supplementary
140d846f33bSAlexander Ziaeegroup IDs, and it is unspecified whether the effective group ID is
141d846f33bSAlexander Ziaeea member of the list.
142d846f33bSAlexander Ziaee.Pp
143d846f33bSAlexander ZiaeeThe effective user ID and effective group ID are initially the
144d846f33bSAlexander Ziaeeprocess's real user ID and real group ID respectively.
145d846f33bSAlexander ZiaeeEither
146d846f33bSAlexander Ziaeemay be modified through execution of a set-user-ID or set-group-ID file
147d846f33bSAlexander Ziaee.Pq possibly by one its ancestors
148d846f33bSAlexander Ziaee.Pq see Xr execve 2 .
149d846f33bSAlexander ZiaeeBy convention, the effective group ID
150d846f33bSAlexander Ziaee.Pq the first member of the group access list
151d846f33bSAlexander Ziaeeis duplicated, so that the execution of a set-group-ID program
152d846f33bSAlexander Ziaeedoes not result in the loss of the original
153d846f33bSAlexander Ziaee.Pq real
154d846f33bSAlexander Ziaeegroup ID.
155d846f33bSAlexander Ziaee.Pp
156d846f33bSAlexander ZiaeeThe group access list is a set of group IDs
157d846f33bSAlexander Ziaeeused only in determining resource accessibility.
158d846f33bSAlexander ZiaeeAccess checks
159d846f33bSAlexander Ziaeeare performed as described below in ``File Access Permissions''.
160d846f33bSAlexander Ziaee.It Saved Set User ID and Saved Set Group ID
161d846f33bSAlexander ZiaeeWhen a process executes a new file, the effective user ID is set
162d846f33bSAlexander Ziaeeto the owner of the file if the file is set-user-ID, and the effective
163d846f33bSAlexander Ziaeegroup ID
164d846f33bSAlexander Ziaee.Pq first element of the group access list
165d846f33bSAlexander Ziaeeis set to the group of the file if the file is set-group-ID.
166d846f33bSAlexander ZiaeeThe effective user ID of the process is then recorded as the saved set-user-ID,
167d846f33bSAlexander Ziaeeand the effective group ID of the process is recorded as the saved set-group-ID.
168d846f33bSAlexander ZiaeeThese values may be used to regain those values as the effective user
169d846f33bSAlexander Ziaeeor group ID after reverting to the real ID
170d846f33bSAlexander Ziaee.Pq see Xr setuid 2 .
171d846f33bSAlexander ZiaeeIn POSIX.1, the saved set-user-ID and saved set-group-ID are optional,
172d846f33bSAlexander Ziaeeand are used in setuid and setgid, but this does not work as desired
173d846f33bSAlexander Ziaeefor the super-user.
174d846f33bSAlexander Ziaee.It Super-user
175d846f33bSAlexander ZiaeeA process is recognized as a
176d846f33bSAlexander Ziaee.Em super-user
177d846f33bSAlexander Ziaeeprocess and is granted special privileges if its effective user ID is 0.
178d846f33bSAlexander Ziaee.It Descriptor
179d846f33bSAlexander ZiaeeAn integer assigned by the system when a file is referenced
180d846f33bSAlexander Ziaeeby
181d846f33bSAlexander Ziaee.Xr open 2
182d846f33bSAlexander Ziaeeor
183d846f33bSAlexander Ziaee.Xr dup 2 ,
184d846f33bSAlexander Ziaeeor when a socket is created by
185d846f33bSAlexander Ziaee.Xr pipe 2 ,
186d846f33bSAlexander Ziaee.Xr socket 2
187d846f33bSAlexander Ziaeeor
188d846f33bSAlexander Ziaee.Xr socketpair 2 ,
189d846f33bSAlexander Ziaeewhich uniquely identifies an access path to that file or socket from
190d846f33bSAlexander Ziaeea given process or any of its children.
191d846f33bSAlexander Ziaee.It File Name
192d846f33bSAlexander ZiaeeNames consisting of up to
193d846f33bSAlexander Ziaee.Brq Dv NAME_MAX
194d846f33bSAlexander Ziaeecharacters may be used to name
195d846f33bSAlexander Ziaeean ordinary file, special file, or directory.
196d846f33bSAlexander Ziaee.Pp
197d846f33bSAlexander ZiaeeThese characters may be arbitrary eight-bit values,
198d846f33bSAlexander Ziaeeexcluding
199d846f33bSAlexander Ziaee.Dv NUL
200d846f33bSAlexander Ziaee.Pq ASCII 0
201d846f33bSAlexander Ziaeeand the
202d846f33bSAlexander Ziaee.Ql \&/
203d846f33bSAlexander Ziaeecharacter
204d846f33bSAlexander Ziaee.Pq slash, ASCII 47 .
205d846f33bSAlexander Ziaee.Pp
206d846f33bSAlexander ZiaeeNote that it is generally unwise to use
207d846f33bSAlexander Ziaee.Ql \&* ,
208d846f33bSAlexander Ziaee.Ql \&? ,
209d846f33bSAlexander Ziaee.Ql \&[
210d846f33bSAlexander Ziaeeor
211d846f33bSAlexander Ziaee.Ql \&]
212d846f33bSAlexander Ziaeeas part of
213d846f33bSAlexander Ziaeefile names because of the special meaning attached to these characters
214d846f33bSAlexander Ziaeeby the shell.
215d846f33bSAlexander Ziaee.It Path Name
216d846f33bSAlexander ZiaeeA path name is a
217d846f33bSAlexander Ziaee.Dv NUL Ns -terminated
218d846f33bSAlexander Ziaeecharacter string starting with an
219d846f33bSAlexander Ziaeeoptional slash
220d846f33bSAlexander Ziaee.Ql \&/ ,
221d846f33bSAlexander Ziaeefollowed by zero or more directory names separated
222d846f33bSAlexander Ziaeeby slashes, optionally followed by a file name.
223d846f33bSAlexander ZiaeeThe total length of a path name must be less than
224d846f33bSAlexander Ziaee.Brq Dv PATH_MAX
225d846f33bSAlexander Ziaeecharacters.
226d846f33bSAlexander ZiaeeOn some systems, this limit may be infinite.
227d846f33bSAlexander Ziaee.Pp
228d846f33bSAlexander ZiaeeIf a path name begins with a slash, the path search begins at the
229d846f33bSAlexander Ziaee.Em root
230d846f33bSAlexander Ziaeedirectory.
231d846f33bSAlexander ZiaeeOtherwise, the search begins from the current working directory.
232d846f33bSAlexander ZiaeeA slash by itself names the root directory.
233d846f33bSAlexander ZiaeeAn empty
234d846f33bSAlexander Ziaeepathname refers to the current directory.
235d846f33bSAlexander Ziaee.It Directory
236d846f33bSAlexander ZiaeeA directory is a special type of file that contains entries
237d846f33bSAlexander Ziaeethat are references to other files.
238d846f33bSAlexander ZiaeeDirectory entries are called links.
239d846f33bSAlexander ZiaeeBy convention, a directory
240d846f33bSAlexander Ziaeecontains at least two links,
241d846f33bSAlexander Ziaee.Ql .\&
242d846f33bSAlexander Ziaeeand
243d846f33bSAlexander Ziaee.Ql \&.. ,
244d846f33bSAlexander Ziaeereferred to as
245d846f33bSAlexander Ziaee.Em dot
246d846f33bSAlexander Ziaeeand
247d846f33bSAlexander Ziaee.Em dot-dot
248d846f33bSAlexander Ziaeerespectively.
249d846f33bSAlexander ZiaeeDot refers to the directory itself and
250d846f33bSAlexander Ziaeedot-dot refers to its parent directory.
251d846f33bSAlexander Ziaee.It Root Directory and Current Working Directory
252d846f33bSAlexander ZiaeeEach process has associated with it a concept of a root directory
253d846f33bSAlexander Ziaeeand a current working directory for the purpose of resolving path
254d846f33bSAlexander Ziaeename searches.
255d846f33bSAlexander ZiaeeA process's root directory need not be the root
256d846f33bSAlexander Ziaeedirectory of the root file system.
257d846f33bSAlexander Ziaee.It File Access Permissions
258d846f33bSAlexander ZiaeeEvery file in the file system has a set of access permissions.
259d846f33bSAlexander ZiaeeThese permissions are used in determining whether a process
260d846f33bSAlexander Ziaeemay perform a requested operation on the file
261d846f33bSAlexander Ziaee.Pq such as opening a file for writing .
262d846f33bSAlexander ZiaeeAccess permissions are established at the
263d846f33bSAlexander Ziaeetime a file is created.
264d846f33bSAlexander ZiaeeThey may be changed at some later time
265d846f33bSAlexander Ziaeethrough the
266d846f33bSAlexander Ziaee.Xr chmod 2
267d846f33bSAlexander Ziaeecall.
268d846f33bSAlexander Ziaee.Pp
269d846f33bSAlexander ZiaeeFile access is broken down according to whether a file may be: read,
270d846f33bSAlexander Ziaeewritten, or executed.
271d846f33bSAlexander ZiaeeDirectory files use the execute
272d846f33bSAlexander Ziaeepermission to control if the directory may be searched.
273d846f33bSAlexander Ziaee.Pp
274d846f33bSAlexander ZiaeeFile access permissions are interpreted by the system as
275d846f33bSAlexander Ziaeethey apply to three different classes of users: the owner
276d846f33bSAlexander Ziaeeof the file, those users in the file's group, anyone else.
277d846f33bSAlexander ZiaeeEvery file has an independent set of access permissions for
278d846f33bSAlexander Ziaeeeach of these classes.
279d846f33bSAlexander ZiaeeWhen an access check is made, the system
280d846f33bSAlexander Ziaeedecides if permission should be granted by checking the access
281d846f33bSAlexander Ziaeeinformation applicable to the caller.
282d846f33bSAlexander Ziaee.Pp
283d846f33bSAlexander ZiaeeRead, write, and execute/search permissions on
284d846f33bSAlexander Ziaeea file are granted to a process if:
285d846f33bSAlexander Ziaee.Pp
286d846f33bSAlexander ZiaeeThe process's effective user ID is that of the super-user.
287d846f33bSAlexander ZiaeeNote that even the super-user cannot execute a non-executable file.
288d846f33bSAlexander Ziaee.Pp
289d846f33bSAlexander ZiaeeThe process's effective user ID matches the user ID of the owner
290d846f33bSAlexander Ziaeeof the file and the owner permissions allow the access.
291d846f33bSAlexander Ziaee.Pp
292d846f33bSAlexander ZiaeeThe process's effective user ID does not match the user ID of the
293d846f33bSAlexander Ziaeeowner of the file, and either the process's effective
294d846f33bSAlexander Ziaeegroup ID matches the group ID
295d846f33bSAlexander Ziaeeof the file, or the group ID of the file is in
296d846f33bSAlexander Ziaeethe process's group access list,
297d846f33bSAlexander Ziaeeand the group permissions allow the access.
298d846f33bSAlexander Ziaee.Pp
299d846f33bSAlexander ZiaeeNeither the effective user ID nor effective group ID
300d846f33bSAlexander Ziaeeand group access list of the process
301d846f33bSAlexander Ziaeematch the corresponding user ID and group ID of the file,
302d846f33bSAlexander Ziaeebut the permissions for ``other users'' allow access.
303d846f33bSAlexander Ziaee.Pp
304d846f33bSAlexander ZiaeeOtherwise, permission is denied.
305d846f33bSAlexander Ziaee.It Sockets and Address Families
306d846f33bSAlexander ZiaeeA socket is an endpoint for communication between processes.
307d846f33bSAlexander ZiaeeEach socket has queues for sending and receiving data.
308d846f33bSAlexander Ziaee.Pp
309d846f33bSAlexander ZiaeeSockets are typed according to their communications properties.
310d846f33bSAlexander ZiaeeThese properties include whether messages sent and received
311d846f33bSAlexander Ziaeeat a socket require the name of the partner, whether communication
312d846f33bSAlexander Ziaeeis reliable, the format used in naming message recipients, etc.
313d846f33bSAlexander Ziaee.Pp
314d846f33bSAlexander ZiaeeEach instance of the system supports some
315d846f33bSAlexander Ziaeecollection of socket types; consult
316d846f33bSAlexander Ziaee.Xr socket 2
317d846f33bSAlexander Ziaeefor more information about the types available and
318d846f33bSAlexander Ziaeetheir properties.
319d846f33bSAlexander Ziaee.Pp
320d846f33bSAlexander ZiaeeEach instance of the system supports some number of sets of
321d846f33bSAlexander Ziaeecommunications protocols.
322d846f33bSAlexander ZiaeeEach protocol set supports addresses
323d846f33bSAlexander Ziaeeof a certain format.
324d846f33bSAlexander ZiaeeAn Address Family is the set of addresses
325d846f33bSAlexander Ziaeefor a specific group of protocols.
326d846f33bSAlexander ZiaeeEach socket has an address
327d846f33bSAlexander Ziaeechosen from the address family in which the socket was created.
328d846f33bSAlexander Ziaee.El
329d846f33bSAlexander Ziaee.Sh FILES
330d846f33bSAlexander Ziaee.Bl -inset -compact
331d846f33bSAlexander Ziaee.It Pa /usr/include/sys/syscall.h
332d846f33bSAlexander ZiaeeTable of currently available system calls.
333d846f33bSAlexander Ziaee.El
334d846f33bSAlexander Ziaee.Sh ERRORS
3358269e767SBrooks DavisNearly all of the system calls provide an error number referenced via
3369e8df790SAlexander Ziaeethe external identifier
337*9a62cdc0SAlexander Ziaee.Nm errno .
3388269e767SBrooks DavisThis identifier is defined in
3398269e767SBrooks Davis.In sys/errno.h
3409e8df790SAlexander Ziaeeas:
3418269e767SBrooks Davis.Pp
3428269e767SBrooks Davis.Dl extern    int *       __error();
3438269e767SBrooks Davis.Dl #define   errno       (* __error())
3448269e767SBrooks Davis.Pp
3458269e767SBrooks DavisThe
3468269e767SBrooks Davis.Va __error()
3478269e767SBrooks Davisfunction returns a pointer to a field in the thread specific structure for
3488269e767SBrooks Davisthreads other than the initial thread.
3498269e767SBrooks DavisFor the initial thread and
3508269e767SBrooks Davisnon-threaded processes,
3518269e767SBrooks Davis.Va __error()
3528269e767SBrooks Davisreturns a pointer to a global
353*9a62cdc0SAlexander Ziaee.Nm errno
3548269e767SBrooks Davisvariable that is compatible with the previous definition.
3558269e767SBrooks Davis.Pp
3568269e767SBrooks DavisWhen a system call detects an error,
3578269e767SBrooks Davisit returns an integer value
3589e8df790SAlexander Ziaeeindicating failure
3599e8df790SAlexander Ziaee.Pq usually -1
3608269e767SBrooks Davisand sets the variable
361*9a62cdc0SAlexander Ziaee.Nm errno
3628269e767SBrooks Davisaccordingly.
3639e8df790SAlexander ZiaeeThis allows interpretation of the failure on receiving
3649e8df790SAlexander Ziaee-1 and to take action accordingly.
3658269e767SBrooks DavisSuccessful calls never set
366*9a62cdc0SAlexander Ziaee.Nm errno ;
3678269e767SBrooks Davisonce set, it remains until another error occurs.
3688269e767SBrooks DavisIt should only be examined after an error.
3698269e767SBrooks DavisNote that a number of system calls overload the meanings of these
3708269e767SBrooks Daviserror numbers, and that the meanings must be interpreted according
3718269e767SBrooks Davisto the type and circumstances of the call.
3728269e767SBrooks Davis.Pp
3738269e767SBrooks DavisThe following is a complete list of the errors and their
3748269e767SBrooks Davisnames as given in
3758269e767SBrooks Davis.In sys/errno.h .
3768269e767SBrooks Davis.Bl -hang -width Ds
3778269e767SBrooks Davis.It Er 0 Em "Undefined error: 0" .
3788269e767SBrooks DavisNot used.
3798269e767SBrooks Davis.It Er 1 EPERM Em "Operation not permitted" .
3808269e767SBrooks DavisAn attempt was made to perform an operation limited to processes
3818269e767SBrooks Daviswith appropriate privileges or to the owner of a file or other
3828269e767SBrooks Davisresources.
3838269e767SBrooks Davis.It Er 2 ENOENT Em "No such file or directory" .
3848269e767SBrooks DavisA component of a specified pathname did not exist, or the
3858269e767SBrooks Davispathname was an empty string.
3868269e767SBrooks Davis.It Er 3 ESRCH Em "No such process" .
3878269e767SBrooks DavisNo process could be found corresponding to that specified by the given
3888269e767SBrooks Davisprocess ID.
3898269e767SBrooks Davis.It Er 4 EINTR Em "Interrupted system call" .
3909e8df790SAlexander ZiaeeAn asynchronous signal
3919e8df790SAlexander Ziaee.Pq such as Dv SIGINT or Dv SIGQUIT
3928269e767SBrooks Daviswas caught by the process during the execution of an interruptible
3938269e767SBrooks Davisfunction.
3948269e767SBrooks DavisIf the signal handler performs a normal return, the
3958269e767SBrooks Davisinterrupted system call will seem to have returned the error condition.
3968269e767SBrooks Davis.It Er 5 EIO Em "Input/output error" .
3978269e767SBrooks DavisSome physical input or output error occurred.
3988269e767SBrooks DavisThis error will not be reported until a subsequent operation on the same file
3999e8df790SAlexander Ziaeedescriptor and may be lost
4009e8df790SAlexander Ziaee.Pq over written
4019e8df790SAlexander Ziaeeby any subsequent errors.
4028269e767SBrooks Davis.It Er 6 ENXIO Em "Device not configured" .
4038269e767SBrooks DavisInput or output on a special file referred to a device that did not
4048269e767SBrooks Davisexist, or
4058269e767SBrooks Davismade a request beyond the limits of the device.
4068269e767SBrooks DavisThis error may also occur when, for example,
4078269e767SBrooks Davisa tape drive is not online or no disk pack is
4088269e767SBrooks Davisloaded on a drive.
4098269e767SBrooks Davis.It Er 7 E2BIG Em "Argument list too long" .
4108269e767SBrooks DavisThe number of bytes used for the argument and environment
4118269e767SBrooks Davislist of the new process exceeded the current limit
4129e8df790SAlexander Ziaee.Pq Dv NCARGS in In sys/param.h .
4138269e767SBrooks Davis.It Er 8 ENOEXEC Em "Exec format error" .
4148269e767SBrooks DavisA request was made to execute a file
4158269e767SBrooks Davisthat, although it has the appropriate permissions,
4168269e767SBrooks Daviswas not in the format required for an
4178269e767SBrooks Davisexecutable file.
4188269e767SBrooks Davis.It Er 9 EBADF Em "Bad file descriptor" .
4198269e767SBrooks DavisA file descriptor argument was out of range, referred to no open file,
4209e8df790SAlexander Ziaeeor a read
4219e8df790SAlexander Ziaee.Pq write
4229e8df790SAlexander Ziaeerequest was made to a file that was only open for writing
4239e8df790SAlexander Ziaee.Pq reading .
4248269e767SBrooks Davis.It Er 10 ECHILD Em "\&No child processes" .
4258269e767SBrooks DavisA
4269e8df790SAlexander Ziaee.Xr wait 2 or Xr waitpid 2
4278269e767SBrooks Davisfunction was executed by a process that had no existing or unwaited-for
4288269e767SBrooks Davischild processes.
4298269e767SBrooks Davis.It Er 11 EDEADLK Em "Resource deadlock avoided" .
4308269e767SBrooks DavisAn attempt was made to lock a system resource that
4318269e767SBrooks Daviswould have resulted in a deadlock situation.
4328269e767SBrooks Davis.It Er 12 ENOMEM Em "Cannot allocate memory" .
4338269e767SBrooks DavisThe new process image required more memory than was allowed by the hardware
4348269e767SBrooks Davisor by system-imposed memory management constraints.
4358269e767SBrooks DavisA lack of swap space is normally temporary; however,
4368269e767SBrooks Davisa lack of core is not.
4378269e767SBrooks DavisSoft limits may be increased to their corresponding hard limits.
4388269e767SBrooks Davis.It Er 13 EACCES Em "Permission denied" .
4398269e767SBrooks DavisAn attempt was made to access a file in a way forbidden
4408269e767SBrooks Davisby its file access permissions.
4418269e767SBrooks Davis.It Er 14 EFAULT Em "Bad address" .
4428269e767SBrooks DavisThe system detected an invalid address in attempting to
4438269e767SBrooks Davisuse an argument of a call.
4448269e767SBrooks Davis.It Er 15 ENOTBLK Em "Block device required" .
4458269e767SBrooks DavisA block device operation was attempted on a non-block device or file.
4468269e767SBrooks Davis.It Er 16 EBUSY Em "Device busy" .
4478269e767SBrooks DavisAn attempt to use a system resource which was in use at the time
4488269e767SBrooks Davisin a manner which would have conflicted with the request.
4498269e767SBrooks Davis.It Er 17 EEXIST Em "File exists" .
4508269e767SBrooks DavisAn existing file was mentioned in an inappropriate context,
4518269e767SBrooks Davisfor instance, as the new link name in a
4528269e767SBrooks Davis.Xr link 2
4538269e767SBrooks Davissystem call.
4548269e767SBrooks Davis.It Er 18 EXDEV Em "Cross-device link" .
4558269e767SBrooks DavisA hard link to a file on another file system
4568269e767SBrooks Daviswas attempted.
4578269e767SBrooks Davis.It Er 19 ENODEV Em "Operation not supported by device" .
4588269e767SBrooks DavisAn attempt was made to apply an inappropriate
4598269e767SBrooks Davisfunction to a device,
4608269e767SBrooks Davisfor example,
4618269e767SBrooks Davistrying to read a write-only device such as a printer.
4628269e767SBrooks Davis.It Er 20 ENOTDIR Em "Not a directory" .
4638269e767SBrooks DavisA component of the specified pathname existed, but it was
4648269e767SBrooks Davisnot a directory, when a directory was expected.
4658269e767SBrooks Davis.It Er 21 EISDIR Em "Is a directory" .
4668269e767SBrooks DavisAn attempt was made to open a directory with write mode specified.
4678269e767SBrooks Davis.It Er 22 EINVAL Em "Invalid argument" .
4688269e767SBrooks DavisSome invalid argument was supplied.
4699e8df790SAlexander ZiaeeFor example, specifying an undefined signal to a
4708269e767SBrooks Davis.Xr signal 3
4719e8df790SAlexander Ziaeefunction or a
4728269e767SBrooks Davis.Xr kill 2
4739e8df790SAlexander Ziaeesystem call.
4748269e767SBrooks Davis.It Er 23 ENFILE Em "Too many open files in system" .
4758269e767SBrooks DavisMaximum number of open files allowable on the system
4768269e767SBrooks Davishas been reached and requests for an open cannot be satisfied
4778269e767SBrooks Davisuntil at least one has been closed.
4788269e767SBrooks Davis.It Er 24 EMFILE Em "Too many open files" .
4798269e767SBrooks DavisMaximum number of file descriptors allowable in the process
4808269e767SBrooks Davishas been reached and requests for an open cannot be satisfied
4818269e767SBrooks Davisuntil at least one has been closed.
4828269e767SBrooks DavisThe
4838269e767SBrooks Davis.Xr getdtablesize 2
4848269e767SBrooks Davissystem call will obtain the current limit.
4858269e767SBrooks Davis.It Er 25 ENOTTY Em "Inappropriate ioctl for device" .
4869e8df790SAlexander ZiaeeA control function
4879e8df790SAlexander Ziaee.Pq see Xr ioctl 2
4888269e767SBrooks Daviswas attempted for a file or
4898269e767SBrooks Davisspecial device for which the operation was inappropriate.
4908269e767SBrooks Davis.It Er 26 ETXTBSY Em "Text file busy" .
4919e8df790SAlexander ZiaeeThe new process was a pure procedure
4929e8df790SAlexander Ziaee.Pq shared text
4939e8df790SAlexander Ziaeefile which was open for writing by another process, or
4948269e767SBrooks Daviswhile the pure procedure file was being executed an
4958269e767SBrooks Davis.Xr open 2
4968269e767SBrooks Daviscall requested write access.
4978269e767SBrooks Davis.It Er 27 EFBIG Em "File too large" .
4988269e767SBrooks DavisThe size of a file exceeded the maximum.
4998269e767SBrooks Davis.It Er 28 ENOSPC Em "No space left on device" .
5008269e767SBrooks DavisA
5018269e767SBrooks Davis.Xr write 2
5028269e767SBrooks Davisto an ordinary file, the creation of a
5038269e767SBrooks Davisdirectory or symbolic link, or the creation of a directory
5048269e767SBrooks Davisentry failed because no more disk blocks were available
5058269e767SBrooks Davison the file system, or the allocation of an inode for a newly
5068269e767SBrooks Daviscreated file failed because no more inodes were available
5078269e767SBrooks Davison the file system.
5088269e767SBrooks Davis.It Er 29 ESPIPE Em "Illegal seek" .
5098269e767SBrooks DavisAn
5108269e767SBrooks Davis.Xr lseek 2
5119e8df790SAlexander Ziaeesystem call was issued on a socket, pipe or FIFO.
5128269e767SBrooks Davis.It Er 30 EROFS Em "Read-only file system" .
5138269e767SBrooks DavisAn attempt was made to modify a file or directory
5148269e767SBrooks Davison a file system that was read-only at the time.
5158269e767SBrooks Davis.It Er 31 EMLINK Em "Too many links" .
5166dfbe695SAlexander ZiaeeMaximum allowable hard links to a single file has been exceeded.
5176dfbe695SAlexander ZiaeeThis limit is a filesystem dependent variable
5186dfbe695SAlexander Ziaee.Po
5196dfbe695SAlexander Ziaee.Va UFS_LINK_MAX No on Xr ufs 4 ,
5206dfbe695SAlexander Ziaee.Va FUSE_LINK_MAX No on Xr fusefs 4 , and
5216dfbe695SAlexander Ziaee.Va TMPFS_MAX No on Xr tmpfs 4
5226dfbe695SAlexander Ziaee.Pc .
5238269e767SBrooks Davis.It Er 32 EPIPE Em "Broken pipe" .
5249e8df790SAlexander ZiaeeA write on a pipe, socket or FIFO for which there is no process to read
5259e8df790SAlexander Ziaeethe data.
5268269e767SBrooks Davis.It Er 33 EDOM Em "Numerical argument out of domain" .
5278269e767SBrooks DavisA numerical input argument was outside the defined domain of the mathematical
5288269e767SBrooks Davisfunction.
5298269e767SBrooks Davis.It Er 34 ERANGE Em "Result too large" .
5308269e767SBrooks DavisA numerical result of the function was too large to fit in the
5319e8df790SAlexander Ziaeeavailable space
5329e8df790SAlexander Ziaee.Pq perhaps exceeded precision .
5338269e767SBrooks Davis.It Er 35 EAGAIN Em "Resource temporarily unavailable" .
5348269e767SBrooks DavisThis is a temporary condition and later calls to the
5358269e767SBrooks Davissame routine may complete normally.
5368269e767SBrooks Davis.It Er 36 EINPROGRESS Em "Operation now in progress" .
5379e8df790SAlexander ZiaeeAn operation that takes a long time to complete, such as
5389e8df790SAlexander Ziaee.Xr connect 2 ,
5399e8df790SAlexander Ziaeewas attempted on a non-blocking object
5409e8df790SAlexander Ziaee.Pq see Xr fcntl 2 .
5418269e767SBrooks Davis.It Er 37 EALREADY Em "Operation already in progress" .
5428269e767SBrooks DavisAn operation was attempted on a non-blocking object that already
5438269e767SBrooks Davishad an operation in progress.
5448269e767SBrooks Davis.It Er 38 ENOTSOCK Em "Socket operation on non-socket" .
5458269e767SBrooks DavisSelf-explanatory.
5468269e767SBrooks Davis.It Er 39 EDESTADDRREQ Em "Destination address required" .
5478269e767SBrooks DavisA required address was omitted from an operation on a socket.
5488269e767SBrooks Davis.It Er 40 EMSGSIZE Em "Message too long" .
5498269e767SBrooks DavisA message sent on a socket was larger than the internal message buffer
5508269e767SBrooks Davisor some other network limit.
5518269e767SBrooks Davis.It Er 41 EPROTOTYPE Em "Protocol wrong type for socket" .
5528269e767SBrooks DavisA protocol was specified that does not support the semantics of the
5538269e767SBrooks Davissocket type requested.
5549e8df790SAlexander ZiaeeFor example, you cannot use the ARPA Internet UDP protocol with type
5558269e767SBrooks Davis.Dv SOCK_STREAM .
5568269e767SBrooks Davis.It Er 42 ENOPROTOOPT Em "Protocol not available" .
5578269e767SBrooks DavisA bad option or level was specified in a
5588269e767SBrooks Davis.Xr getsockopt 2
5598269e767SBrooks Davisor
5608269e767SBrooks Davis.Xr setsockopt 2
5618269e767SBrooks Daviscall.
5628269e767SBrooks Davis.It Er 43 EPROTONOSUPPORT Em "Protocol not supported" .
5638269e767SBrooks DavisThe protocol has not been configured into the
5648269e767SBrooks Davissystem or no implementation for it exists.
5658269e767SBrooks Davis.It Er 44 ESOCKTNOSUPPORT Em "Socket type not supported" .
5668269e767SBrooks DavisThe support for the socket type has not been configured into the
5678269e767SBrooks Davissystem or no implementation for it exists.
5688269e767SBrooks Davis.It Er 45 EOPNOTSUPP Em "Operation not supported" .
5698269e767SBrooks DavisThe attempted operation is not supported for the type of object referenced.
5708269e767SBrooks DavisUsually this occurs when a file descriptor refers to a file or socket
5718269e767SBrooks Davisthat cannot support this operation,
5728269e767SBrooks Davisfor example, trying to
5738269e767SBrooks Davis.Em accept
5748269e767SBrooks Davisa connection on a datagram socket.
5758269e767SBrooks Davis.It Er 46 EPFNOSUPPORT Em "Protocol family not supported" .
5768269e767SBrooks DavisThe protocol family has not been configured into the
5778269e767SBrooks Davissystem or no implementation for it exists.
5788269e767SBrooks Davis.It Er 47 EAFNOSUPPORT Em "Address family not supported by protocol family" .
5798269e767SBrooks DavisAn address incompatible with the requested protocol was used.
5808269e767SBrooks DavisFor example, you should not necessarily expect to be able to use
5819e8df790SAlexander ZiaeeNS addresses with ARPA Internet protocols.
5828269e767SBrooks Davis.It Er 48 EADDRINUSE Em "Address already in use" .
5838269e767SBrooks DavisOnly one usage of each address is normally permitted.
5848269e767SBrooks Davis.It Er 49 EADDRNOTAVAIL Em "Can't assign requested address" .
5858269e767SBrooks DavisNormally results from an attempt to create a socket with an
5868269e767SBrooks Davisaddress not on this machine.
5878269e767SBrooks Davis.It Er 50 ENETDOWN Em "Network is down" .
5888269e767SBrooks DavisA socket operation encountered a dead network.
5898269e767SBrooks Davis.It Er 51 ENETUNREACH Em "Network is unreachable" .
5908269e767SBrooks DavisA socket operation was attempted to an unreachable network.
5918269e767SBrooks Davis.It Er 52 ENETRESET Em "Network dropped connection on reset" .
5928269e767SBrooks DavisThe host you were connected to crashed and rebooted.
5938269e767SBrooks Davis.It Er 53 ECONNABORTED Em "Software caused connection abort" .
5948269e767SBrooks DavisA connection abort was caused internal to your host machine.
5958269e767SBrooks Davis.It Er 54 ECONNRESET Em "Connection reset by peer" .
5968269e767SBrooks DavisA connection was forcibly closed by a peer.
5978269e767SBrooks DavisThis normally
5988269e767SBrooks Davisresults from a loss of the connection on the remote socket
5998269e767SBrooks Davisdue to a timeout or a reboot.
6008269e767SBrooks Davis.It Er 55 ENOBUFS Em "\&No buffer space available" .
6018269e767SBrooks DavisAn operation on a socket or pipe was not performed because
6028269e767SBrooks Davisthe system lacked sufficient buffer space or because a queue was full.
6038269e767SBrooks Davis.It Er 56 EISCONN Em "Socket is already connected" .
6048269e767SBrooks DavisA
6058269e767SBrooks Davis.Xr connect 2
6068269e767SBrooks Davisrequest was made on an already connected socket; or,
6078269e767SBrooks Davisa
6088269e767SBrooks Davis.Xr sendto 2
6098269e767SBrooks Davisor
6108269e767SBrooks Davis.Xr sendmsg 2
6118269e767SBrooks Davisrequest on a connected socket specified a destination
6128269e767SBrooks Daviswhen already connected.
6138269e767SBrooks Davis.It Er 57 ENOTCONN Em "Socket is not connected" .
6148269e767SBrooks DavisAn request to send or receive data was disallowed because
6159e8df790SAlexander Ziaeethe socket was not connected and
6169e8df790SAlexander Ziaee.Pq when sending on a datagram socket
6178269e767SBrooks Davisno address was supplied.
6188269e767SBrooks Davis.It Er 58 ESHUTDOWN Em "Can't send after socket shutdown" .
6198269e767SBrooks DavisA request to send data was disallowed because the socket
6208269e767SBrooks Davishad already been shut down with a previous
6218269e767SBrooks Davis.Xr shutdown 2
6228269e767SBrooks Daviscall.
6238269e767SBrooks Davis.It Er 60 ETIMEDOUT Em "Operation timed out" .
6248269e767SBrooks DavisA
6258269e767SBrooks Davis.Xr connect 2
6268269e767SBrooks Davisor
6278269e767SBrooks Davis.Xr send 2
6288269e767SBrooks Davisrequest failed because the connected party did not
6298269e767SBrooks Davisproperly respond after a period of time.
6309e8df790SAlexander ZiaeeThe timeout period is dependent on the communication protocol.
6318269e767SBrooks Davis.It Er 61 ECONNREFUSED Em "Connection refused" .
6328269e767SBrooks DavisNo connection could be made because the target machine actively
6338269e767SBrooks Davisrefused it.
6348269e767SBrooks DavisThis usually results from trying to connect
6358269e767SBrooks Davisto a service that is inactive on the foreign host.
6368269e767SBrooks Davis.It Er 62 ELOOP Em "Too many levels of symbolic links" .
6378269e767SBrooks DavisA path name lookup involved more than 32
6388269e767SBrooks Davis.Pq Dv MAXSYMLINKS
6398269e767SBrooks Davissymbolic links.
6408269e767SBrooks Davis.It Er 63 ENAMETOOLONG Em "File name too long" .
6418269e767SBrooks DavisA component of a path name exceeded
6428269e767SBrooks Davis.Brq Dv NAME_MAX
6438269e767SBrooks Davischaracters, or an entire
6448269e767SBrooks Davispath name exceeded
6458269e767SBrooks Davis.Brq Dv PATH_MAX
6468269e767SBrooks Davischaracters.
6479e8df790SAlexander ZiaeeSee also the description of
6489e8df790SAlexander Ziaee.Dv _PC_NO_TRUNC in Xr pathconf 2 .
6498269e767SBrooks Davis.It Er 64 EHOSTDOWN Em "Host is down" .
6508269e767SBrooks DavisA socket operation failed because the destination host was down.
6518269e767SBrooks Davis.It Er 65 EHOSTUNREACH Em "No route to host" .
6528269e767SBrooks DavisA socket operation was attempted to an unreachable host.
6538269e767SBrooks Davis.It Er 66 ENOTEMPTY Em "Directory not empty" .
6548269e767SBrooks DavisA directory with entries other than
6558269e767SBrooks Davis.Ql .\&
6568269e767SBrooks Davisand
6578269e767SBrooks Davis.Ql ..\&
6588269e767SBrooks Daviswas supplied to a remove directory or rename call.
6598269e767SBrooks Davis.It Er 67 EPROCLIM Em "Too many processes" .
6608269e767SBrooks Davis.It Er 68 EUSERS Em "Too many users" .
6618269e767SBrooks DavisThe quota system ran out of table entries.
6628269e767SBrooks Davis.It Er 69 EDQUOT Em "Disc quota exceeded" .
6638269e767SBrooks DavisA
6648269e767SBrooks Davis.Xr write 2
6658269e767SBrooks Davisto an ordinary file, the creation of a
6668269e767SBrooks Davisdirectory or symbolic link, or the creation of a directory
6678269e767SBrooks Davisentry failed because the user's quota of disk blocks was
6688269e767SBrooks Davisexhausted, or the allocation of an inode for a newly
6698269e767SBrooks Daviscreated file failed because the user's quota of inodes
6708269e767SBrooks Daviswas exhausted.
6718269e767SBrooks Davis.It Er 70 ESTALE Em "Stale NFS file handle" .
6729e8df790SAlexander ZiaeeAn attempt was made to access an open file
6739e8df790SAlexander Ziaee.Pq on an NFS file system
6748269e767SBrooks Daviswhich is now unavailable as referenced by the file descriptor.
6759e8df790SAlexander ZiaeeThis may indicate the file was deleted on the NFS server or some
6768269e767SBrooks Davisother catastrophic event occurred.
6778269e767SBrooks Davis.It Er 72 EBADRPC Em "RPC struct is bad" .
6789e8df790SAlexander ZiaeeExchange of RPC information was unsuccessful.
6798269e767SBrooks Davis.It Er 73 ERPCMISMATCH Em "RPC version wrong" .
6809e8df790SAlexander ZiaeeThe version of RPC on the remote peer is not compatible with
6818269e767SBrooks Davisthe local version.
6828269e767SBrooks Davis.It Er 74 EPROGUNAVAIL Em "RPC prog. not avail" .
6838269e767SBrooks DavisThe requested program is not registered on the remote host.
6848269e767SBrooks Davis.It Er 75 EPROGMISMATCH Em "Program version wrong" .
6858269e767SBrooks DavisThe requested version of the program is not available
6868269e767SBrooks Davison the remote host
6879e8df790SAlexander Ziaee.Pq RPC .
6888269e767SBrooks Davis.It Er 76 EPROCUNAVAIL Em "Bad procedure for program" .
6899e8df790SAlexander ZiaeeAn RPC call was attempted for a procedure which does not exist
6908269e767SBrooks Davisin the remote program.
6918269e767SBrooks Davis.It Er 77 ENOLCK Em "No locks available" .
6928269e767SBrooks DavisA system-imposed limit on the number of simultaneous file
6938269e767SBrooks Davislocks was reached.
6948269e767SBrooks Davis.It Er 78 ENOSYS Em "Function not implemented" .
6958269e767SBrooks DavisAttempted a system call that is not available on this
6968269e767SBrooks Davissystem.
6978269e767SBrooks Davis.It Er 79 EFTYPE Em "Inappropriate file type or format" .
6988269e767SBrooks DavisThe file was the wrong type for the operation, or a data file had
6998269e767SBrooks Davisthe wrong format.
7008269e767SBrooks Davis.It Er 80 EAUTH Em "Authentication error" .
7018269e767SBrooks DavisAttempted to use an invalid authentication ticket to mount a
7029e8df790SAlexander ZiaeeNFS file system.
7038269e767SBrooks Davis.It Er 81 ENEEDAUTH Em "Need authenticator" .
7049e8df790SAlexander ZiaeeAn authentication ticket must be obtained before the given NFS
7058269e767SBrooks Davisfile system may be mounted.
7068269e767SBrooks Davis.It Er 82 EIDRM Em "Identifier removed" .
7078269e767SBrooks DavisAn IPC identifier was removed while the current process was waiting on it.
7088269e767SBrooks Davis.It Er 83 ENOMSG Em "No message of desired type" .
7098269e767SBrooks DavisAn IPC message queue does not contain a message of the desired type, or a
7108269e767SBrooks Davismessage catalog does not contain the requested message.
7118269e767SBrooks Davis.It Er 84 EOVERFLOW Em "Value too large to be stored in data type" .
7128269e767SBrooks DavisA numerical result of the function was too large to be stored in the caller
7138269e767SBrooks Davisprovided space.
7148269e767SBrooks Davis.It Er 85 ECANCELED Em "Operation canceled" .
7158269e767SBrooks DavisThe scheduled operation was canceled.
7168269e767SBrooks Davis.It Er 86 EILSEQ Em "Illegal byte sequence" .
7178269e767SBrooks DavisWhile decoding a multibyte character the function came along an
7188269e767SBrooks Davisinvalid or an incomplete sequence of bytes or the given wide
7198269e767SBrooks Davischaracter is invalid.
7208269e767SBrooks Davis.It Er 87 ENOATTR Em "Attribute not found" .
7218269e767SBrooks DavisThe specified extended attribute does not exist.
7228269e767SBrooks Davis.It Er 88 EDOOFUS Em "Programming error" .
7238269e767SBrooks DavisA function or API is being abused in a way which could only be detected
7248269e767SBrooks Davisat run-time.
7258269e767SBrooks Davis.It Er 89 EBADMSG Em "Bad message" .
7268269e767SBrooks DavisA corrupted message was detected.
7278269e767SBrooks Davis.It Er 90 EMULTIHOP Em "Multihop attempted" .
7288269e767SBrooks DavisThis error code is unused, but present for compatibility with other systems.
7298269e767SBrooks Davis.It Er 91 ENOLINK Em "Link has been severed" .
7308269e767SBrooks DavisThis error code is unused, but present for compatibility with other systems.
7318269e767SBrooks Davis.It Er 92 EPROTO Em "Protocol error" .
7328269e767SBrooks DavisA device or socket encountered an unrecoverable protocol error.
7338269e767SBrooks Davis.It Er 93 ENOTCAPABLE Em "Capabilities insufficient" .
7348269e767SBrooks DavisAn operation on a capability file descriptor requires greater privilege than
7358269e767SBrooks Davisthe capability allows.
7368269e767SBrooks Davis.It Er 94 ECAPMODE Em "Not permitted in capability mode" .
7378269e767SBrooks DavisThe system call or operation is not permitted for capability mode processes.
7388269e767SBrooks Davis.It Er 95 ENOTRECOVERABLE Em "State not recoverable" .
7398269e767SBrooks DavisThe state protected by a robust mutex is not recoverable.
7408269e767SBrooks Davis.It Er 96 EOWNERDEAD Em "Previous owner died" .
7418269e767SBrooks DavisThe owner of a robust mutex terminated while holding the mutex lock.
7428269e767SBrooks Davis.It Er 97 EINTEGRITY Em "Integrity check failed" .
7438269e767SBrooks DavisAn integrity check such as a check-hash or a cross-correlation failed.
7448269e767SBrooks DavisThe integrity error falls in the kernel I/O stack between
7458269e767SBrooks Davis.Er EINVAL
7468269e767SBrooks Davisthat identifies errors in parameters to a system call and
7478269e767SBrooks Davis.Er EIO
7488269e767SBrooks Davisthat identifies errors with the underlying storage media.
7498269e767SBrooks DavisIt is typically raised by intermediate kernel layers such as a
7508269e767SBrooks Davisfilesystem or an in-kernel GEOM subsystem when they detect inconsistencies.
7518269e767SBrooks DavisUses include allowing the
7528269e767SBrooks Davis.Xr mount 8
7538269e767SBrooks Daviscommand to return a different exit value to automate the running of
7548269e767SBrooks Davis.Xr fsck 8
7558269e767SBrooks Davisduring a system boot.
7568269e767SBrooks Davis.El
7578269e767SBrooks Davis.Sh SEE ALSO
7588269e767SBrooks Davis.Xr intro 3 ,
7598269e767SBrooks Davis.Xr perror 3
760bcc57e97SAlexander Ziaee.Sh HISTORY
761bcc57e97SAlexander ZiaeeThe
762bcc57e97SAlexander Ziaee.Nm Ns Pq 2
763bcc57e97SAlexander Ziaeemanual page first appeared in
764bcc57e97SAlexander Ziaee.At v5 .
765