errno.3: Note use of errno(1) to look up error names and numbers

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-11-23 10:03:40 +01:00
parent bf3683a153
commit 44a35dc807
1 changed files with 31 additions and 0 deletions

View File

@ -100,6 +100,37 @@ On Linux, the error numbers that correspond to each symbolic name
vary somewhat across architectures.
Therefore, numeric values are not included in the list of
error names below.
On any particular system,
one can obtain a list of all symbolic error names and
the corresponding error numbers using the
.BR errno (1)
command:
.PP
.in +4n
.EX
$ \fBerrno \-l\fP
EPERM 1 Operation not permitted
ENOENT 2 No such file or directory
ESRCH 3 No such process
EINTR 4 Interrupted system call
EIO 5 Input/output error
\&...
.EE
.in
.PP
The
.BR errno (1)
command can also be used to look up individual error numbers and names
as in the following examples:
.PP
.in +4n
.EX
$ \fBerrno 2\fP
ENOENT 2 No such file or directory
$ \fBerrno ESRCH\fP
ESRCH 3 No such process
.EE
.in
.PP
.\" POSIX.1 (2001 edition) lists the following symbolic error names. Of
.\" these, \fBEDOM\fP and \fBERANGE\fP are in the ISO C standard. ISO C