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, miscellaneous descriptions of the setting
of 'errno' are reworded to the norm of "is set to indicate
the error".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-01-07 10:04:40 +01:00
parent c112329ffe
commit cb6a894ee7
15 changed files with 46 additions and 47 deletions

View File

@ -138,9 +138,9 @@ if \-1 is an error or a legitimate value.
.PP
.BR setpriority ()
returns 0 on success.
On error, it returns \-1 and sets
On failure, it returns \-1 and sets
.I errno
to indicate the cause of the error.
to indicate the error.
.SH ERRORS
.TP
.B EINVAL

View File

@ -99,12 +99,12 @@ and
cannot be caught or ignored.
.SH RETURN VALUE
.BR signal ()
returns the previous value of the signal handler, or
.B SIG_ERR
on error.
In the event of an error,
returns the previous value of the signal handler
On failure, it returns
.BR SIG_ERR ,
and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL

View File

@ -53,10 +53,10 @@ The mask of pending signals is returned in
.IR set .
.SH RETURN VALUE
.BR sigpending ()
returns 0 on success and \-1 on error.
In the event of an error,
returns 0 on success.
On failure, \-1 is returned and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EFAULT

View File

@ -107,10 +107,10 @@ is unspecified in a multithreaded process; see
.BR pthread_sigmask (3).
.SH RETURN VALUE
.BR sigprocmask ()
returns 0 on success and \-1 on error.
In the event of an error,
returns 0 on success.
On failure, \-1 is returned and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EFAULT

View File

@ -88,7 +88,7 @@ structure,
or NULL if there are no more entries or an error occurs.
In the event of an error,
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B ENOMEM

View File

@ -92,7 +92,7 @@ structure, or NULL if
there are no more entries or an error occurs.
In the event of an error,
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B ENOMEM

View File

@ -52,14 +52,14 @@ There is no reason ever to use it.
For nonlocking counterparts, see
.BR unlocked_stdio (3).
.SH RETURN VALUE
The
On success,
.BR fgetwc ()
function returns the next wide-character
from the stream, or
.BR WEOF .
In the event of an error,
returns the next wide-character from the stream.
Otherwise,
.B WEOF
is returned, and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
Apart from the usual ones, there is
.TP

View File

@ -51,14 +51,15 @@ There is no reason ever to use it.
For nonlocking counterparts, see
.BR unlocked_stdio (3).
.SH RETURN VALUE
The
On success,
.BR fputwc ()
function returns \fIwc\fP if no error occurred, or
function returns
.IR wc .
Otherwise,
.B WEOF
to indicate an error.
In the event of an error,
is returned, and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
Apart from the usual ones, there is
.TP

View File

@ -114,9 +114,9 @@ to handle embedded null bytes in the line read.
.PP
Both functions return \-1 on failure to read a line (including end-of-file
condition).
In the event of an error,
In the event of a failure,
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL

View File

@ -133,9 +133,9 @@ on failure, it returns NULL.
.BR utmpname ()
returns 0 if the new name was successfully stored, or \-1 on failure.
.PP
In the event of an error, these functions
On failure, these functions
.I errno
set to indicate the cause.
set to indicate the error.
.SH ERRORS
.TP
.B ENOMEM

View File

@ -70,9 +70,9 @@ function returns 1 if the file descriptor
is of type
.IR fdtype
and 0 if it is not.
On error, -1 is returned and
On failure, \-1 is returned and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
The
.BR isfdtype ()

View File

@ -48,10 +48,10 @@ must be zero.
.SH RETURN VALUE
On success,
.BR malloc_info ()
returns 0;
on error, it returns \-1, with
returns 0.
On failure, it returns \-1, and
.I errno
set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL

View File

@ -71,11 +71,10 @@ so altering the string changes the environment.
.SH RETURN VALUE
The
.BR putenv ()
function returns zero on success,
or nonzero if an error occurs.
In the event of an error,
function returns zero on success.
On failure, it returns a nonzero value, and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B ENOMEM

View File

@ -75,11 +75,10 @@ struct passwd {
.SH RETURN VALUE
The
.BR putpwent ()
function returns 0 on success, or \-1 if an error
occurs.
In the event of an error,
function returns 0 on success.
On failure, it returns \-1, and
.I errno
is set to indicate the cause.
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL

View File

@ -129,16 +129,16 @@ function returns no value.
The
.BR initstate ()
function returns a pointer to the previous state array.
On error,
On failure, it returns NULL, and
.I errno
is set to indicate the cause.
is set to indicate the error.
.PP
On success,
.BR setstate ()
returns a pointer to the previous state array.
On error, it returns NULL, with
On failure, it returns NULL, and
.I errno
set to indicate the error.
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL