HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)
s
shmctl(2) shmctl(2)
[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.
[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 appropriate
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.
[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 pro-
cess 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().
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().
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).
STANDARDS CONFORMANCE
shmctl(): SVID2, SVID3, XPG2, XPG3, XPG4
398 Hewlett-Packard Company − 2 − HP-UX 11i Version 2: December 2007 Update