1 .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH IPC 5 1993-11-01 "Linux 0.99.13" "Linux Programmer's Manual"
25 ipc \- System V interprocess communication mechanisms
29 # include <sys/types.h>
39 This manual page refers to the Linux implementation of the System V
40 interprocess communication mechanisms:
41 message queues, semaphore sets, and shared memory segments.
42 In the following, the word
44 means an instantiation of one among such mechanisms.
45 .SS Resource Access Permissions
46 For each resource, the system uses a common structure of type
48 to store information needed in determining permissions to perform an
52 structure, defined by the
54 system header file, includes the following members:
62 /* creator group id */
80 structure defines, with its lower 9 bits, the access permissions to the
81 resource for a process executing an ipc system call.
82 The permissions are interpreted as follows:
95 Bits 0100, 0010, and 0001 (the execute bits) are unused by the system.
102 The same system header file also defines the following symbolic
106 Create entry if key doesn't exist.
112 Error if request must wait.
121 Set resource options.
124 Get resource options.
130 type, while all the other symbolic constants are flag fields and can
135 A message queue is uniquely identified by a positive integer
137 and has an associated data structure of type
138 .BR "struct msquid_ds" ,
141 containing the following members:
144 struct ipc_perm msg_perm;
148 /* no of messages on queue */
152 /* bytes max on a queue */
156 /* pid of last msgsnd call */
160 /* pid of last msgrcv call */
164 /* last msgsnd time */
168 /* last msgrcv time */
172 /* last change time */
176 structure that specifies the access permissions on the message
180 Number of messages currently on the message queue.
183 Maximum number of bytes of message text allowed on the message
187 ID of the process that performed the last
192 ID of the process that performed the last
208 system call that changed a member of the
212 A semaphore set is uniquely identified by a positive integer
214 and has an associated data structure of type
215 .BR "struct semid_ds" ,
218 containing the following members:
221 struct ipc_perm sem_perm;
225 /* last operation time */
229 /* last change time */
233 /* count of sems in set */
237 structure that specifies the access permissions on the semaphore
248 system call that changed a member of the above structure or of one
249 semaphore belonging to the set.
252 Number of semaphores in the set.
253 Each semaphore of the set is referenced by a non-negative integer
259 A semaphore is a data structure of type
261 containing the following members:
265 /* semaphore value */
269 /* pid for last operation */
273 /* nr awaiting semval to increase */
277 /* nr awaiting semval = 0 */
280 Semaphore value: a non-negative integer.
283 ID of the last process that performed a semaphore operation
287 Number of processes suspended awaiting for
292 Number of processes suspended awaiting for
295 .SS Shared Memory Segments
296 A shared memory segment is uniquely identified by a positive integer
298 and has an associated data structure of type
299 .BR "struct shmid_ds" ,
302 containing the following members:
305 struct ipc_perm shm_perm;
309 /* size of segment */
317 /* pid, last operation */
321 /* no. of current attaches */
325 /* time of last attach */
329 /* time of last detach */
333 /* time of last change */
337 structure that specifies the access permissions on the shared memory
341 Size in bytes of the shared memory segment.
344 ID of the process that created the shared memory segment.
347 ID of the last process that executed a
354 Number of current alive attaches for this shared memory segment.
369 system call that changed