.\" 2006-02-09 Kurt Wall, mtk
.\" Added non-POSIX errors
.\"
-.TH ERRNO 3 2017-09-15 "" "Linux Programmer's Manual"
+.TH ERRNO 3 2018-02-02 "" "Linux Programmer's Manual"
.SH NAME
errno \- number of last error
.SH SYNOPSIS
.BR EWOULDBLOCK ,
which may be the same.
.PP
-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
+The error numbers that correspond to each symbolic name
+vary across UNIX systems,
+and even across different architectures on Linux.
+Therefore, numeric values are not included as part of the list of
error names below.
-On any particular system,
+The
+.BR perror (3)
+and
+.BR strerror (3)
+functions can be used to convert these names to
+corresponding textual error messages.
+.PP
+On any particular Linux system,
one can obtain a list of all symbolic error names and
the corresponding error numbers using the
.BR errno (1)
-command:
+command (part of the
+.I moreutils
+package):
.PP
.in +4n
.EX
.PP
The
.BR errno (1)
-command can also be used to look up individual error numbers and names
+command can also be used to look up individual error numbers and names,
+and to search for errors using strings from the error description,
as in the following examples:
.PP
.in +4n
ENOENT 2 No such file or directory
$ \fBerrno ESRCH\fP
ESRCH 3 No such process
+$ \fBerrno \-s permission\fP
+EACCES 13 Permission denied
.EE
.in
.PP
No medium found.
.TP
.B ENOMEM
-Not enough space (POSIX.1-2001).
+Not enough space/cannot allocate memory (POSIX.1-2001).
.TP
.B ENOMSG
No message of the desired type (POSIX.1-2001).
Streams pipe error.
.TP
.B ETIME
-Timer expired.
-(POSIX.1 (XSI STREAMS option))
+Timer expired
+(POSIX.1 (XSI STREAMS option)).
.IP
(POSIX.1 says "STREAM
.BR ioctl (2)
-timeout")
+timeout".)
.TP
.B ETIMEDOUT
Connection timed out (POSIX.1-2001).
.EE
.in
.PP
-It was common in traditional C to declare
+On some ancient systems,
+.I <errno.h>
+was not present or did not declare
+.IR errno ,
+so that it was necessary to declare
.I errno
manually
(i.e.,
-.IR "extern int errno" )
-instead of including
-.IR <errno.h> .
+.IR "extern int errno" ).
.BR "Do not do this" .
-It will not work with modern versions of the C library.
-However, on (very) old UNIX systems, there may be no
-.I <errno.h>
-and the declaration is needed.
+It long ago ceased to be necessary,
+and it will cause problems with modern versions of the C library.
.SH SEE ALSO
.BR errno (1), \" In the moreutils package
.BR err (3),