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, "to indicate the cause of the error"
is changed to "to indicate the error".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-01-07 07:50:50 +01:00
parent 3cf2958737
commit 855d489a7f
47 changed files with 56 additions and 56 deletions

View File

@ -147,7 +147,7 @@ On success,
returns the serial number of the key it created or updated. returns the serial number of the key it created or updated.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EACCES .B EACCES

View File

@ -1320,7 +1320,7 @@ was invoked via
.BR syscall (2)), .BR syscall (2)),
all operations return \-1 and set all operations return \-1 and set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.PP .PP
The return value on success depends on the operation, The return value on success depends on the operation,
as described in the following list: as described in the following list:

View File

@ -123,7 +123,7 @@ On success,
returns the calling thread's nice value, which may be a negative number. returns the calling thread's nice value, which may be a negative number.
On error, it returns \-1 and sets On error, it returns \-1 and sets
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.PP .PP
Since a successful call to Since a successful call to
.BR getpriority () .BR getpriority ()

View File

@ -53,7 +53,7 @@ On success,
returns zero. returns zero.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EBADF .B EBADF

View File

@ -235,7 +235,7 @@ This
operation returns 0 on success. operation returns 0 on success.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.TP .TP
.B EFAULT .B EFAULT
@ -333,7 +333,7 @@ This
operation returns 0 on success. operation returns 0 on success.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.\" FIXME Is the following error list correct? .\" FIXME Is the following error list correct?
.\" .\"
@ -386,7 +386,7 @@ This
operation returns 0 on success. operation returns 0 on success.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.TP .TP
.B EINVAL .B EINVAL
@ -466,7 +466,7 @@ operation returns 0 on success.
In this case, the entire area was copied. In this case, the entire area was copied.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.TP .TP
.B EAGAIN .B EAGAIN
@ -570,7 +570,7 @@ operation returns 0 on success.
In this case, the entire area was zeroed. In this case, the entire area was zeroed.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.TP .TP
.B EAGAIN .B EAGAIN
@ -636,7 +636,7 @@ This
operation returns 0 on success. operation returns 0 on success.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Possible errors include: Possible errors include:
.TP .TP
.B EINVAL .B EINVAL

View File

@ -497,14 +497,14 @@ On error, the value
.IR "(void\ *)\ \-1" ) .IR "(void\ *)\ \-1" )
is returned, and is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.PP .PP
On success, On success,
.BR munmap () .BR munmap ()
returns 0. returns 0.
On failure, it returns \-1, and On failure, it returns \-1, and
.I errno .I errno
is set to indicate the cause of the error (probably to is set to indicate the error (probably to
.BR EINVAL ). .BR EINVAL ).
.SH ERRORS .SH ERRORS
.TP .TP

View File

@ -282,7 +282,7 @@ returns a file descriptor (a nonnegative integer).
.PP .PP
In the event of an error, both system calls return \-1 and set In the event of an error, both system calls return \-1 and set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.BR name_to_handle_at () .BR name_to_handle_at ()
and and

View File

@ -193,7 +193,7 @@ Reset PMC registers to default values.
returns zero when the operation is successful. returns zero when the operation is successful.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH VERSIONS .SH VERSIONS
.BR perfmonctl () .BR perfmonctl ()
is available since Linux 2.4. is available since Linux 2.4.

View File

@ -74,7 +74,7 @@ On success,
returns a file descriptor (a nonnegative integer). returns a file descriptor (a nonnegative integer).
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EBADF .B EBADF

View File

@ -53,7 +53,7 @@ On success,
returns a file descriptor (a nonnegative integer). returns a file descriptor (a nonnegative integer).
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -96,7 +96,7 @@ On success,
returns 0. returns 0.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EBADF .B EBADF

View File

@ -354,7 +354,7 @@ before any file descriptors became read.
.PP .PP
On error, \-1 is returned, and On error, \-1 is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EFAULT .B EFAULT

View File

@ -89,7 +89,7 @@ and
.PP .PP
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.BR pread () .BR pread ()
can fail and set can fail and set

View File

@ -68,7 +68,7 @@ On success,
.BR readahead () .BR readahead ()
returns 0; on failure, \-1 is returned, with returns 0; on failure, \-1 is returned, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EBADF .B EBADF

View File

@ -378,7 +378,7 @@ On success,
returns the serial number of the key it found or caused to be created. returns the serial number of the key it found or caused to be created.
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EACCES .B EACCES

View File

@ -303,7 +303,7 @@ and
return 0. return 0.
On error, \-1 is returned, and On error, \-1 is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.BR sched_getattr () .BR sched_getattr ()
and and

View File

@ -727,7 +727,7 @@ and
.BR gettid (2).) .BR gettid (2).)
On other errors, \-1 is returned, and On other errors, \-1 is returned, and
.IR errno .IR errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.BR seccomp () .BR seccomp ()
can fail for the following reasons: can fail for the following reasons:

View File

@ -170,13 +170,13 @@ returns the address of the attached shared memory segment; on error,
.I (void\ *)\ \-1 .I (void\ *)\ \-1
is returned, and is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.PP .PP
On success, On success,
.BR shmdt () .BR shmdt ()
returns 0; on error \-1 is returned, and returns 0; on error \-1 is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
When When
.BR shmat () .BR shmat ()

View File

@ -104,7 +104,7 @@ On success,
returns zero. returns zero.
On error, \-1 is returned, and On error, \-1 is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EFAULT .B EFAULT

View File

@ -98,7 +98,7 @@ see NOTES for the upper limit on Linux.
.SH RETURN VALUE .SH RETURN VALUE
On success, the number of bytes written is returned. On success, the number of bytes written is returned.
On error, \-1 is returned, and \fIerrno\fP is set On error, \-1 is returned, and \fIerrno\fP is set
to indicate the cause of the error. to indicate the error.
.PP .PP
Note that a successful Note that a successful
.BR write () .BR write ()

View File

@ -70,7 +70,7 @@ has no way to return the port number actually allocated.
.BR bindresvport () .BR bindresvport ()
returns 0 on success; otherwise \-1 is returned and returns 0 on success; otherwise \-1 is returned and
.I errno .I errno
set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.BR bindresvport () .BR bindresvport ()
can fail for any of the same reasons as can fail for any of the same reasons as

View File

@ -311,7 +311,7 @@ returns the value
The remaining functions return NULL on error. The remaining functions return NULL on error.
On error, On error,
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EOVERFLOW .B EOVERFLOW

View File

@ -64,7 +64,7 @@ On success,
returns a file descriptor (a nonnegative integer). returns a file descriptor (a nonnegative integer).
On error, \-1 is returned, and On error, \-1 is returned, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
POSIX.1-2008 specifies two errors, POSIX.1-2008 specifies two errors,
neither of which is returned by the current neither of which is returned by the current

View File

@ -66,7 +66,7 @@ On error, it returns
.IR "(locale_t)\ 0", .IR "(locale_t)\ 0",
and sets and sets
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B ENOMEM .B ENOMEM

View File

@ -176,7 +176,7 @@ The return value of these functions is one of the following:
.IP * 3 .IP * 3
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error is set to indicate the error
(for example, (for example,
.BR EINVAL , .BR EINVAL ,
indicating that indicating that

View File

@ -47,7 +47,7 @@ On success,
these functions return a nonnegative value as given in DESCRIPTION. these functions return a nonnegative value as given in DESCRIPTION.
On failure, they return \-1 and set On failure, they return \-1 and set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B ENOSYS .B ENOSYS

View File

@ -107,7 +107,7 @@ precisely because the user can set \fBLOGNAME\fP arbitrarily.
returns a pointer to the username when successful, returns a pointer to the username when successful,
and NULL on failure, with and NULL on failure, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.BR getlogin_r () .BR getlogin_r ()
returns 0 when successful, and nonzero on failure. returns 0 when successful, and nonzero on failure.
.SH ERRORS .SH ERRORS

View File

@ -208,7 +208,7 @@ are available or if an error occurs during processing.
The functions which have \fIint\fP as the return value return 0 for The functions which have \fIint\fP as the return value return 0 for
success and \-1 for failure, with success and \-1 for failure, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.PP .PP
For the nonreentrant functions, the return value may point to static area, For the nonreentrant functions, the return value may point to static area,
and may be overwritten by subsequent calls to these functions. and may be overwritten by subsequent calls to these functions.

View File

@ -175,7 +175,7 @@ and
return nonzero on success. return nonzero on success.
They return 0 on error, with They return 0 on error, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.PP .PP
On success, On success,
.BR hsearch () .BR hsearch ()
@ -189,7 +189,7 @@ cannot be found in the hash table.
returns nonzero on success, and 0 on error. returns nonzero on success, and 0 on error.
In the event of an error, these two functions set In the event of an error, these two functions set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.BR hcreate_r () .BR hcreate_r ()
and and

View File

@ -125,7 +125,7 @@ On success,
returns the number of bits in the network number. returns the number of bits in the network number.
On error, it returns \-1, and On error, it returns \-1, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.PP .PP
On success, On success,
.BR inet_net_ntop () .BR inet_net_ntop ()
@ -133,7 +133,7 @@ returns
.IR pres . .IR pres .
On error, it returns NULL, and On error, it returns NULL, and
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EAFNOSUPPORT .B EAFNOSUPPORT

View File

@ -181,7 +181,7 @@ returns
.IR "(locale_t)\ 0", .IR "(locale_t)\ 0",
and sets and sets
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -135,7 +135,7 @@ and
.BR pvalloc () .BR pvalloc ()
return a pointer to the allocated memory on success. return a pointer to the allocated memory on success.
On error, NULL is returned, and \fIerrno\fP is set On error, NULL is returned, and \fIerrno\fP is set
to indicate the cause of the error. to indicate the error.
.PP .PP
.BR posix_memalign () .BR posix_memalign ()
returns zero on success, or one of the error values listed in the returns zero on success, or one of the error values listed in the

View File

@ -58,7 +58,7 @@ On success,
.IR pthread_mutex_consistent () .IR pthread_mutex_consistent ()
returns 0. returns 0.
Otherwise, Otherwise,
it returns a positive error number to indicate the cause of the error. it returns a positive error number to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -138,7 +138,7 @@ On success,
returns a pointer to the previous state array. returns a pointer to the previous state array.
On error, it returns NULL, with On error, it returns NULL, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -127,7 +127,7 @@ or be the result of a previous call of
All of these functions return 0 on success. All of these functions return 0 on success.
On error, \-1 is returned, with On error, \-1 is returned, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -178,7 +178,7 @@ function returns the number of directory entries
selected. selected.
On error, \-1 is returned, with On error, \-1 is returned, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.PP .PP
The The
.BR alphasort () .BR alphasort ()

View File

@ -107,7 +107,7 @@ and
functions return zero on success, functions return zero on success,
or \-1 on error, with or \-1 on error, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -178,7 +178,7 @@ returns 0 on success, or \-1 on error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno
is set to indicate the cause of the error. is set to indicate the error.
Values which may appear in Values which may appear in
.I errno .I errno
include the following: include the following:

View File

@ -77,7 +77,7 @@ signal number
.I sig .I sig
is invalid, with is invalid, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -121,7 +121,7 @@ is not a member, and \-1 on error.
.PP .PP
On error, these functions set On error, these functions set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -109,7 +109,7 @@ function returns a pointer to the duplicated
string. string.
It returns NULL if insufficient memory was available, with It returns NULL if insufficient memory was available, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B ENOMEM .B ENOMEM

View File

@ -330,7 +330,7 @@ is one of the following:
.IP * 3 .IP * 3
On error, \-1 is returned and On error, \-1 is returned and
.I errno .I errno
is set to indicate the cause of the error is set to indicate the error
(for example, (for example,
.BR EINVAL , .BR EINVAL ,
indicating that indicating that

View File

@ -102,7 +102,7 @@ On success, the
function returns a pointer to a unique temporary filename. function returns a pointer to a unique temporary filename.
It returns NULL if a unique name cannot be generated, with It returns NULL if a unique name cannot be generated, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B ENOMEM .B ENOMEM

View File

@ -71,7 +71,7 @@ On error, they return the value
.I (time_t)\ \-1 .I (time_t)\ \-1
and set and set
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EOVERFLOW .B EOVERFLOW

View File

@ -81,7 +81,7 @@ On error, it returns
.IR "(locale_t)\ 0" , .IR "(locale_t)\ 0" ,
and sets and sets
.I errno .I errno
to indicate the cause of the error. to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINVAL .B EINVAL

View File

@ -69,7 +69,7 @@ The
function returns 0 on success. function returns 0 on success.
On error, \-1 is returned, with On error, \-1 is returned, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B EINTR .B EINTR

View File

@ -56,7 +56,7 @@ On success,
returns a pointer to the new wide-character string. returns a pointer to the new wide-character string.
On error, it returns NULL, with On error, it returns NULL, with
.I errno .I errno
set to indicate the cause of the error. set to indicate the error.
.SH ERRORS .SH ERRORS
.TP .TP
.B ENOMEM .B ENOMEM