shmctl.2 (2010 09)

s
shmctl(2) shmctl(2)
[EINVAL] shmid is not a valid shared memory identifier.
[EINVAL] cmd is not a valid command, or the command contains invalid parameters.
[ENOMEM] cmd is equal to
SHM_LOCK and there is not sufficient lockable memory to fill the
request.
[EOVERFLOW]
cmd is equal to
IPC_STAT. The attached process count of a shared memory object
is too large for the field in the data structure provided by the application. Recom-
pile the application with the latest /usr/include/sys/ipc.h
file to resolve
this issue.
[EPERM] cmd is equal to
IPC_RMID, IPC_SET
, SHM_LOCK,orSHM_UNLOCK and the
effective user ID of the calling process is not equal to that of a user having appropri-
ate privileges and it is not equal to the value of either
shm_perm.uid or
shm_perm.cuid in the data structure associated with shmid.
cmd is equal to
IPC_SET and the shared memory segment has
relaxed isola-
tion.
[EPERM] cmd is equal to
SHM_LOCK or
SHM_UNLOCK and the effective user ID of the calling
process is not equal to that of a user having appropriate privileges and the calling
process does not have the
PRIV_MLOCK privilege (see getprivgrp (2)).
EXAMPLES
The following call to
shmctl() locks in memory the shared memory segment represented by myshmid.
This example assumes the process has a valid shmid, which can be obtained by calling shmget (2).
shmctl (myshmid, SHM_LOCK, 0);
The following call to shmctl() removes the shared memory segment represented by myshmid. This
example assumes the process has a valid shmid, which can be obtained by calling shmget() (see
shmget(2).
shmctl (myshmid, IPC_RMID, 0);
AUTHOR
shmctl() was developed by AT&T and HP.
SEE ALSO
ipcrm(1), ipcs(1), shmget(2), shmop(2), stdipc(3C), privileges(5),
STANDARDS CONFORMANCE
shmctl(): SVID2, SVID3, XPG2, XPG3, XPG4
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010