| Red Hat Documentation: man pages: man5: Linux User Manual (5) |
IPCSection: Linux Programmer's Manual (5)Updated: November 1, 2025 Index NAMEipc - System V interprocess communication mechanismsSYNOPSIS# include <sys/types.h> # include <sys/ipc.h> # include <sys/msg.h> # include <sys/sem.h> # include <sys/shm.h> DESCRIPTIONThe manual page refers to the Linux implementation of the System V interprocess communication mechanisms: message queues, semaphore sets and shared memory segments. In the following, the word resource means an instantiation of one among such mechanisms.Resource Access PermissionsFor 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 */ 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 defines also the following symbolic constants:
Note that IPC_PRIVATE is a key_t type, while all the others symbolic constants are flag fields or-able into an int type variable. Message QueuesA message queue is uniquely identified by a positive integer (its msqid) and has an associated data structure of type struct msquid_ds, defined in <sys/msg.h>, containing the following members:
struct ipc_perm msg_perm;
Semaphore SetsA semaphore set is uniquely identified by a positive integer (its semid) and has an associated data structure of type struct semid_ds, defined in <sys/sem.h>, containing the following members:
struct ipc_perm sem_perm;
A semaphore is a data structure of type struct sem containing the following members:
ushort semval;
/* semaphore value */
Shared Memory SegmentsA shared memory segment is uniquely identified by a positive integer (its shmid) and has an associated data structure of type struct shmid_ds, defined in <sys/shm.h>, containing the following members:
struct ipc_perm shm_perm;
SEE ALSOshmdt (2).
IndexThis document was created by using the manual pages. Time: 12:12:24 GMT, March 24, 2025 |
|
© 2001 Red Hat, Inc. All rights reserved. About Red Hat : Legal statement : Privacy statement : Y2K statement : Contact Red Hat |