#include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h>
int shmctl (shmid, cmd, buf) int shmid, cmd; struct shmid_ds *buf;
shmctl() provides a variety of shared memory control operations as specified by cmd. The following cmds are available:
shm_perm.uid shm_perm.gid shm_perm.mode /* only low 9 bits */
This cmd can only be executed by a process that has an effective user ID equal to that of super-user, or to the value of shm_perm.cuid or shm_perm.uid in the data structure associated with shmid.
In the shmop.2 and shmctl.2 system call descriptions, the permission required for an operation is given as "[token]", where ``token'' is the type of permission needed interpreted as follows:
Read and Write permissions on a shmid are granted to a process if one or more of the following are true:
The effective user ID of the process is super-user.
The effective user ID of the process matches shm_perm.[c]uid in the data structure associated with shmid and the appropriate bit of the ``user'' portion (0600) of shm_perm.mode is set.
The effective user
ID
of the process does not match
shm_perm.[c]uid
and the effective group
ID
of the process matches
shm_perm.[c]gid
and the appropriate bit of the ``group'' portion
(060) of
shm_perm.mode
is set.
The effective user ID of the process does not match shm_perm.[c]uid and the effective group ID of the process does not match shm_perm.[c]gid and the appropriate bit of the ``other'' portion (06) of shm_perm.mode is set.
Otherwise, the corresponding permissions are denied.
shmctl() returns:
cmd is not a valid command.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97