msgget.2, semget.2, shmget.2: The purpose of "flags" == 0 is to obtain ID of an existing IPC object

This was implied in these pages, but the meaning of "flags" == 0
could be more explicit, as indicated by questions such as
https://stackoverflow.com/questions/49833569/flag-value-of-semget-function

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2018-04-14 22:35:53 +02:00
parent d934a28ce9
commit f8ac3de383
3 changed files with 25 additions and 0 deletions

View File

@ -50,6 +50,14 @@ system call returns the System\ V message queue identifier associated
with the value of the
.I key
argument.
It may be used either to obtain the identifier of a previously created
message queue (when
.I msgflg
is zero and
.I key
does not have the value
.BR IPC_PRIVATE ),
or to create a new set.
.PP
A new message queue is created if
.I key

View File

@ -52,6 +52,15 @@ The
system call returns the System\ V semaphore set identifier
associated with the argument
.IR key .
It may be used either to obtain the identifier of a previously created
semaphore set (when
.I semflg
is zero and
.I key
does not have the value
.BR IPC_PRIVATE ),
or to create a new set.
.PP
A new set of
.I nsems
semaphores is created if

View File

@ -51,6 +51,14 @@ shmget \- allocates a System V shared memory segment
returns the identifier of the System\ V shared memory segment
associated with the value of the argument
.IR key .
It may be used either to obtain the identifier of a previously created
shared memory segment (when
.I shmflg
is zero and
.I key
does not have the value
.BR IPC_PRIVATE ),
or to create a new set.
.PP
A new shared memory segment, with size equal to the value of
.I size