Resource Access Permissions
For each resource, the system uses a common structure of type "struct ipc_perm" to store information needed in determining permissions to perform an ipc operation. The ipc_perm structure, defined by the <sys/ipc.h> system header file, includes the following members:
ushort cuid; /* creator user id */
ushort cgid; /* creator group id */
ushort uid; /* owner user id */
ushort gid; /* owner group id */
ushort mode; /* r/w permissions */
The mode member of the ipc_perm structure defines, with its lower 9 bits, the access permissions to the resource for a process executing an ipc system call. The permissions are interpreted as follows:
0400 Read by user.
0200 Write by user.
0040 Read by group.
0020 Write by group.
0004 Read by others.
0002 Write by others.
Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. Furthermore, "write" effectively means "alter" for a semaphore set.
The same system header file also defines the following symbolic constants: