Various System V IPC pages: Improve wording describing RETURN VALUE and setting of 'errno'

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2021-01-07 10:23:22 +01:00
parent cb6a894ee7
commit 9862ec0c5c
6 changed files with 28 additions and 27 deletions

View File

@ -331,9 +331,9 @@ or
operation returns the identifier of the queue whose index was given in operation returns the identifier of the queue whose index was given in
.IR msqid . .IR msqid .
.PP .PP
On error, \-1 is returned with On failure, \-1 is returned and
.I errno .I errno
indicating the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno

View File

@ -144,11 +144,12 @@ If the message queue already exists the permissions are
verified, and a check is made to see if it is marked for verified, and a check is made to see if it is marked for
destruction. destruction.
.SH RETURN VALUE .SH RETURN VALUE
If successful, the return value will be the message queue identifier (a On success,
nonnegative integer), otherwise \-1 .BR msgget ()
with returns the message queue identifier (a nonnegative integer).
On failure, \-1 is returned, and
.I errno .I errno
indicating the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno

View File

@ -336,11 +336,7 @@ is decremented by 1.
.I msg_rtime .I msg_rtime
is set to the current time. is set to the current time.
.SH RETURN VALUE .SH RETURN VALUE
On failure both functions return \-1 On success,
with
.I errno
indicating the error,
otherwise
.BR msgsnd () .BR msgsnd ()
returns 0 returns 0
and and
@ -348,6 +344,9 @@ and
returns the number of bytes actually copied into the returns the number of bytes actually copied into the
.I mtext .I mtext
array. array.
On failure, both functions return \-1, and set
.I errno
to indicate the error.
.SH ERRORS .SH ERRORS
When When
.BR msgsnd () .BR msgsnd ()

View File

@ -395,14 +395,9 @@ If the changes to semaphore values would permit blocked
calls in other processes to proceed, then those processes are woken up. calls in other processes to proceed, then those processes are woken up.
The calling process must have alter permission on the semaphore set. The calling process must have alter permission on the semaphore set.
.SH RETURN VALUE .SH RETURN VALUE
On failure, On success,
.BR semctl () .BR semctl ()
returns \-1 returns a nonnegative value depending on
with
.I errno
indicating the error.
.PP
Otherwise, the system call returns a nonnegative value depending on
.I cmd .I cmd
as follows: as follows:
.TP .TP
@ -447,6 +442,12 @@ as for
All other All other
.I cmd .I cmd
values return 0 on success. values return 0 on success.
.PP
On failure,
.BR semctl ()
returns \-1 and sets
.I errno
to indicate the error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno

View File

@ -155,11 +155,12 @@ If the semaphore set already exists, the permissions are
verified. verified.
.\" and a check is made to see if it is marked for destruction. .\" and a check is made to see if it is marked for destruction.
.SH RETURN VALUE .SH RETURN VALUE
If successful, the return value will be the semaphore set identifier On sucess,
(a nonnegative integer), otherwise, \-1 .BR semget ()
is returned, with ireturns the semaphore set identifier (a nonnegative integer).
On failure, \-1 is returned, and
.I errno .I errno
indicating the error. is set to indicate the error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno

View File

@ -297,15 +297,14 @@ the contents of
.IR timeout .IR timeout
are left unchanged. are left unchanged.
.SH RETURN VALUE .SH RETURN VALUE
If successful, On success,
.BR semop () .BR semop ()
and and
.BR semtimedop () .BR semtimedop ()
return 0; return 0.
otherwise they return \-1 On failure, they return \-1, and set
with
.I errno .I errno
indicating the error. to indicate the error.
.SH ERRORS .SH ERRORS
On failure, On failure,
.I errno .I errno