]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man3/errno.3
fanotify_init.2, fanotify.7: Document FAN_REPORT_TID
[thirdparty/man-pages.git] / man3 / errno.3
index 6f91e7b90901d56d1dcc9807d1e8725a37757e73..301abd9cdf3948c8a3c550eac71c4de2eab2a1fb 100644 (file)
@@ -28,7 +28,7 @@
 .\" 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
@@ -96,15 +96,25 @@ and
 .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
@@ -120,7 +130,8 @@ EIO 5 Input/output error
 .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
@@ -129,6 +140,8 @@ $ \fBerrno 2\fP
 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
@@ -411,7 +424,7 @@ Link has been severed (POSIX.1-2001).
 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).
@@ -546,12 +559,12 @@ This error can occur for NFS and for other filesystems.
 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).
@@ -614,18 +627,18 @@ if (somecall() == \-1) {
 .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),