aboutsummaryrefslogtreecommitdiffstats
path: root/man2
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2021-01-07 09:22:57 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-01-07 14:27:51 +0100
commitc112329ffea6c3ba5be9fc9bb47f285672d582e9 (patch)
treef60425c467c87f92b75cb4ab8850ef53f138d244 /man2
parentf6a4078be5cf1248a561e89b1fb1f1fb61515f41 (diff)
downloadman-pages-c112329ffea6c3ba5be9fc9bb47f285672d582e9.tar.gz
Various pages: Standardize wording around setting of 'errno' on error
In the RETURN VALUE sections, a number of different wordings are used in to describe the fact that 'errno' is set on error. There's no reason for the difference in wordings, since the same thing is being described in each case. Switch to a standard wording that is the same as FreeBSD and similar to the wording used in POSIX.1. In this change, reword various cases saying that 'errno' is set "appropriately" to "is set to indicate the error". Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man2')
-rw-r--r--man2/accept.22
-rw-r--r--man2/clock_getres.25
-rw-r--r--man2/gettimeofday.25
-rw-r--r--man2/ioctl_tty.22
-rw-r--r--man2/keyctl.22
-rw-r--r--man2/mkdir.25
-rw-r--r--man2/mknod.25
-rw-r--r--man2/mlock.23
-rw-r--r--man2/open.28
-rw-r--r--man2/perf_event_open.27
-rw-r--r--man2/pipe.22
-rw-r--r--man2/socketpair.22
12 files changed, 27 insertions, 21 deletions
diff --git a/man2/accept.2 b/man2/accept.2
index bc24f5c813..90551f8e56 100644
--- a/man2/accept.2
+++ b/man2/accept.2
@@ -173,7 +173,7 @@ these system calls return a file descriptor
for the accepted socket (a nonnegative integer).
On error, \-1 is returned,
.I errno
-is set appropriately, and
+is set to indicate the error, and
.I addrlen
is left unchanged.
.SS Error handling
diff --git a/man2/clock_getres.2 b/man2/clock_getres.2
index 9d86e05ba8..936b05a1c6 100644
--- a/man2/clock_getres.2
+++ b/man2/clock_getres.2
@@ -264,9 +264,10 @@ clock_gettime(clkid, &ts);
.BR clock_settime (),
and
.BR clock_getres ()
-return 0 for success, or \-1 for failure (in which case
+return 0 for success.
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
.TP
.B EACCES
diff --git a/man2/gettimeofday.2 b/man2/gettimeofday.2
index 929bea05fa..085b86ad05 100644
--- a/man2/gettimeofday.2
+++ b/man2/gettimeofday.2
@@ -145,9 +145,10 @@ No doubt it is a bad idea to use this feature.
.BR gettimeofday ()
and
.BR settimeofday ()
-return 0 for success, or \-1 for failure (in which case
+return 0 for success.
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
.TP
.B EFAULT
diff --git a/man2/ioctl_tty.2 b/man2/ioctl_tty.2
index 635e85704e..6dfe176e3c 100644
--- a/man2/ioctl_tty.2
+++ b/man2/ioctl_tty.2
@@ -681,7 +681,7 @@ The
system call returns 0 on success.
On error, it returns \-1 and sets
.I errno
-appropriately.
+to indicate the error.
.SH ERRORS
.TP
.B EINVAL
diff --git a/man2/keyctl.2 b/man2/keyctl.2
index ea3a5d3dd0..7eb27bba07 100644
--- a/man2/keyctl.2
+++ b/man2/keyctl.2
@@ -1660,7 +1660,7 @@ Zero.
.PP
On error, \-1 is returned, and
.I errno
-is set appropriately to indicate the error.
+is set to indicate the error.
.SH ERRORS
.TP
.B EACCES
diff --git a/man2/mkdir.2 b/man2/mkdir.2
index 7eccb16458..6934e331a4 100644
--- a/man2/mkdir.2
+++ b/man2/mkdir.2
@@ -113,9 +113,10 @@ for an explanation of the need for
.BR mkdir ()
and
.BR mkdirat ()
-return zero on success, or \-1 if an error occurred (in which case,
+return zero on success.
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
.TP
.B EACCES
diff --git a/man2/mknod.2 b/man2/mknod.2
index bb1b2cc426..fad459d8ce 100644
--- a/man2/mknod.2
+++ b/man2/mknod.2
@@ -152,9 +152,10 @@ for an explanation of the need for
.BR mknod ()
and
.BR mknodat ()
-return zero on success, or \-1 if an error occurred (in which case,
+return zero on success.
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
.TP
.B EACCES
diff --git a/man2/mlock.2 b/man2/mlock.2
index c020ab7359..95bf500ed8 100644
--- a/man2/mlock.2
+++ b/man2/mlock.2
@@ -178,7 +178,8 @@ calling process.
On success, these system calls return 0.
On error, \-1 is returned,
.I errno
-is set appropriately, and no changes are made to any locks in the
+is set to indicate the error,
+and no changes are made to any locks in the
address space of the process.
.SH ERRORS
.TP
diff --git a/man2/open.2 b/man2/open.2
index 781e3aedec..df3a8175d4 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -964,15 +964,15 @@ and provides a superset of the features of
It is documented separately, in
.BR openat2 (2).
.SH RETURN VALUE
+On success,
.BR open (),
.BR openat (),
and
.BR creat ()
-return the new file descriptor (a nonnegative integer),
-or \-1 if an error occurred
-(in which case,
+return the new file descriptor (a nonnegative integer).
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
.BR open (),
.BR openat (),
diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index 95f3286219..19d80de58f 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -3464,11 +3464,12 @@ This is needed when setting up uncore or northbridge events, as
those PMUs present socket-wide events.
.RE
.SH RETURN VALUE
+On success,
.BR perf_event_open ()
-returns the new file descriptor, or \-1 if an error occurred
-(in which case,
+returns the new file descriptor.
+On error, \-1 is returned and
.I errno
-is set appropriately).
+is set to indicate the error.
.SH ERRORS
The errors returned by
.BR perf_event_open ()
diff --git a/man2/pipe.2 b/man2/pipe.2
index ef282300e5..078b579259 100644
--- a/man2/pipe.2
+++ b/man2/pipe.2
@@ -150,7 +150,7 @@ to achieve the same result.
On success, zero is returned.
On error, \-1 is returned,
.I errno
-is set appropriately, and
+is set to indicate the error, and
.I pipefd
is left unchanged.
.PP
diff --git a/man2/socketpair.2 b/man2/socketpair.2
index d09d897b7a..629cf0f48d 100644
--- a/man2/socketpair.2
+++ b/man2/socketpair.2
@@ -71,7 +71,7 @@ The two sockets are indistinguishable.
On success, zero is returned.
On error, \-1 is returned,
.I errno
-is set appropriately, and
+is set to indicate the error, and
.I sv
is left unchanged
.PP