Open System Services System Calls Reference Manual (G06.25+, H06.03+)

shmctl(2) OSS System Calls Reference Manual
NAME
shmctl - Performs shared memory control operations
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
H-series OSS processes: /G/system/zdllnnn/zosskdll
SYNOPSIS
#include <sys/shm.h>
int shmctl(
int shmid,
int cmd,
struct shmid_ds *buf);
PARAMETERS
shmid Species the shared memory identier for the segment.
cmd Species the type of operation. The possible values for cmd and the operations
they perform are as follows:
IPC_RMID Removes the shared memory identier and deallocates its asso-
ciated shmid_ds structure.
This is a restricted operation. The effective user ID of the cal-
ling process either must have appropriate privileges or must be
equal to the value of the creators user ID (shm_perm.cuid
eld) or the owners user ID (shm_perm.uid eld) in the associ-
ated shmid_ds structure.
IPC_SET Sets the shared memory identier by copying selected values in
the structure specied by the buf parameter into the correspond-
ing elds in the shmid_ds structure associated with the shared
memory identier.
This is a restricted operation. The effective user ID of the cal-
ling process either must have appropriate privileges or must be
equal to the value of the creators user ID (shm_perm.cuid
eld) or the owners user ID (shm_perm.uid eld) in the associ-
ated shmid_ds structure.
IPC_STAT Queries the shared memory identier by copying the contents of
its associated shmid_ds structure into the structure specied by
the buf parameter. The calling process must have read access to
the segment.
buf Species the address of a shmid_ds structure. This structure is used only with
the IPC_STAT and IPC_SET values of the cmd parameter. With IPC_STAT,
the results of the query are copied to this structure. With IPC_SET, the values
in this structure are used to set certain elds in the shmid_ds structure associated
with the shared memory identier. In either case, the calling process must have
allocated the structure before making the call.
748 Hewlett-Packard Company 527186-003