1IPCS(P) POSIX Programmer's Manual IPCS(P)
2
3
4
6 ipcs - report XSI interprocess communication facilities status
7
9 ipcs [-qms][-a | -bcopt]
10
12 The ipcs utility shall write information about active interprocess com‐
13 munication facilities.
14
15 Without options, information shall be written in short format for mes‐
16 sage queues, shared memory segments, and semaphore sets that are cur‐
17 rently active in the system. Otherwise, the information that is dis‐
18 played is controlled by the options specified.
19
21 The ipcs facility supports the Base Definitions volume of
22 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
23
24 The ipcs utility accepts the following options:
25
26 -q Write information about active message queues.
27
28 -m Write information about active shared memory segments.
29
30 -s Write information about active semaphore sets.
31
32
33 If -q, -m, or -s are specified, only information about those facilities
34 shall be written. If none of these three are specified, information
35 about all three shall be written subject to the following options:
36
37 -a Use all print options. (This is a shorthand notation for -b, -c,
38 -o, -p, and -t.)
39
40 -b Write information on maximum allowable size. (Maximum number of
41 bytes in messages on queue for message queues, size of segments
42 for shared memory, and number of semaphores in each set for sem‐
43 aphores.)
44
45 -c Write creator's user name and group name; see below.
46
47 -o Write information on outstanding usage. (Number of messages on
48 queue and total number of bytes in messages on queue for message
49 queues, and number of processes attached to shared memory seg‐
50 ments.)
51
52 -p Write process number information. (Process ID of the last
53 process to send a message and process ID of the last process to
54 receive a message on message queues, process ID of the creating
55 process, and process ID of the last process to attach or detach
56 on shared memory segments.)
57
58 -t Write time information. (Time of the last control operation that
59 changed the access permissions for all facilities, time of the
60 last msgsnd() and msgrcv() operations on message queues, time of
61 the last shmat() and shmdt() operations on shared memory, and
62 time of the last semop() operation on semaphores.)
63
64
66 None.
67
69 Not used.
70
72 * The group database
73
74 * The user database
75
77 The following environment variables shall affect the execution of ipcs:
78
79 LANG Provide a default value for the internationalization variables
80 that are unset or null. (See the Base Definitions volume of
81 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
82 ables for the precedence of internationalization variables used
83 to determine the values of locale categories.)
84
85 LC_ALL If set to a non-empty string value, override the values of all
86 the other internationalization variables.
87
88 LC_CTYPE
89 Determine the locale for the interpretation of sequences of
90 bytes of text data as characters (for example, single-byte as
91 opposed to multi-byte characters in arguments).
92
93 LC_MESSAGES
94 Determine the locale that should be used to affect the format
95 and contents of diagnostic messages written to standard error.
96
97 NLSPATH
98 Determine the location of message catalogs for the processing of
99 LC_MESSAGES .
100
101 TZ Determine the timezone for the date and time strings written by
102 ipcs. If TZ is unset or null, an unspecified default timezone
103 shall be used.
104
105
107 Default.
108
110 An introductory line shall be written with the format:
111
112
113 "IPC status from %s as of %s\n", <source>, <date>
114
115 where <source> indicates the source used to gather the statistics and
116 <date> is the information that would be produced by the date command
117 when invoked in the POSIX locale.
118
119 The ipcs utility then shall create up to three reports depending upon
120 the -q, -m, and -s options. The first report shall indicate the status
121 of message queues, the second report shall indicate the status of
122 shared memory segments, and the third report shall indicate the status
123 of semaphore sets.
124
125 If the corresponding facility is not installed or has not been used
126 since the last reboot, then the report shall be written out in the for‐
127 mat:
128
129
130 "%s facility not in system.\n", <facility>
131
132 where <facility> is Message Queue, Shared Memory, or Semaphore, as
133 appropriate. If the facility has been installed and has been used since
134 the last reboot, column headings separated by one or more spaces and
135 followed by a <newline> shall be written as indicated below followed by
136 the facility name written out using the format:
137
138
139 "%s:\n", <facility>
140
141 where <facility> is Message Queues, Shared Memory, or Semaphores, as
142 appropriate. On the second and third reports the column headings need
143 not be written if the last column headings written already provide col‐
144 umn headings for all information in that report.
145
146 The column headings provided in the first column below and the meaning
147 of the information in those columns shall be given in order below; the
148 letters in parentheses indicate the options that shall cause the corre‐
149 sponding column to appear; "all" means that the column shall always
150 appear. Each column is separated by one or more <space>s. Note that
151 these options only determine what information is provided for each
152 report; they do not determine which reports are written.
153
154 T (all)
155 Type of facility:
156
157 q
158 Message queue.
159
160 m
161 Shared memory segment.
162
163 s
164 Semaphore.
165
166
167 This field is a single character written using the format %c .
168
169 ID (all)
170 The identifier for the facility entry. This field shall be writ‐
171 ten using the format %d .
172
173 KEY (all)
174 The key used as an argument to msgget(), semget(), or shmget()
175 to create the facility entry.
176
177 Note:
178 The key of a shared memory segment is changed to IPC_PRIVATE
179 when the segment has been removed until all processes attached
180 to the segment detach it.
181
182 This field shall be written using the format 0x%x.
183
184 MODE (all)
185 The facility access modes and flags. The mode shall consist of
186 11 characters that are interpreted as follows.
187
188 The first character shall be:
189
190 S
191 If a process is waiting on a msgsnd() operation.
192
193 -
194 If the above is not true.
195
196
197 The second character shall be:
198
199 R
200 If a process is waiting on a msgrcv() operation.
201
202 C or -
203 If the associated shared memory segment is to be cleared when
204 the first attach operation is executed.
205
206 -
207 If none of the above is true.
208
209
210 The next nine characters shall be interpreted as three sets of three
211 bits each. The first set refers to the owner's permissions; the next to
212 permissions of others in the usergroup of the facility entry; and the
213 last to all others. Within each set, the first character indicates per‐
214 mission to read, the second character indicates permission to write or
215 alter the facility entry, and the last character is a minus sign ( '-'
216 ).
217
218 The permissions shall be indicated as follows:
219
220 r
221 If read permission is granted.
222
223 w
224 If write permission is granted.
225
226 a
227 If alter permission is granted.
228
229 -
230 If the indicated permission is not granted.
231
232
233 The first character following the permissions specifies if there is an
234 alternate or additional access control method associated with the
235 facility. If there is no alternate or additional access control method
236 associated with the facility, a single <space> shall be written; other‐
237 wise, another printable character is written.
238
239 OWNER (all)
240 The user name of the owner of the facility entry. If the user
241 name of the owner is found in the user database, at least the
242 first eight column positions of the name shall be written using
243 the format %s . Otherwise, the user ID of the owner shall be
244 written using the format %d .
245
246 GROUP (all)
247 The group name of the owner of the facility entry. If the group
248 name of the owner is found in the group database, at least the
249 first eight column positions of the name shall be written using
250 the format %s . Otherwise, the group ID of the owner shall be
251 written using the format %d .
252
253
254 The following nine columns shall be only written out for message
255 queues:
256
257 CREATOR (a,c)
258 The user name of the creator of the facility entry. If the user
259 name of the creator is found in the user database, at least the
260 first eight column positions of the name shall be written using
261 the format %s . Otherwise, the user ID of the creator shall be
262 written using the format %d .
263
264 CGROUP (a,c)
265 The group name of the creator of the facility entry. If the
266 group name of the creator is found in the group database, at
267 least the first eight column positions of the name shall be
268 written using the format %s . Otherwise, the group ID of the
269 creator shall be written using the format %d .
270
271 CBYTES (a,o)
272 The number of bytes in messages currently outstanding on the
273 associated message queue. This field shall be written using the
274 format %d .
275
276 QNUM (a,o)
277 The number of messages currently outstanding on the associated
278 message queue. This field shall be written using the format %d .
279
280 QBYTES (a,b)
281 The maximum number of bytes allowed in messages outstanding on
282 the associated message queue. This field shall be written using
283 the format %d .
284
285 LSPID (a,p)
286 The process ID of the last process to send a message to the
287 associated queue. This field shall be written using the format:
288
289
290 "%d", <pid>
291
292 where <pid> is 0 if no message has been sent to the corresponding mes‐
293 sage queue; otherwise, <pid> shall be the process ID of the last
294 process to send a message to the queue.
295
296 LRPID (a,p)
297 The process ID of the last process to receive a message from the
298 associated queue. This field shall be written using the format:
299
300
301 "%d", <pid>
302
303 where <pid> is 0 if no message has been received from the corresponding
304 message queue; otherwise, <pid> shall be the process ID of the last
305 process to receive a message from the queue.
306
307 STIME (a,t)
308 The time the last message was sent to the associated queue. If a
309 message has been sent to the corresponding message queue, the
310 hour, minute, and second of the last time a message was sent to
311 the queue shall be written using the format %d : %2.2d : %2.2d .
312 Otherwise, the format " no-entry" shall be written.
313
314 RTIME (a,t)
315 The time the last message was received from the associated
316 queue. If a message has been received from the corresponding
317 message queue, the hour, minute, and second of the last time a
318 message was received from the queue shall be written using the
319 format %d : %2.2d : %2.2d . Otherwise, the format " no-entry"
320 shall be written.
321
322
323 The following eight columns shall be only written out for shared memory
324 segments.
325
326 CREATOR (a,c)
327 The user of the creator of the facility entry. If the user name
328 of the creator is found in the user database, at least the first
329 eight column positions of the name shall be written using the
330 format %s . Otherwise, the user ID of the creator shall be writ‐
331 ten using the format %d .
332
333 CGROUP (a,c)
334 The group name of the creator of the facility entry. If the
335 group name of the creator is found in the group database, at
336 least the first eight column positions of the name shall be
337 written using the format %s . Otherwise, the group ID of the
338 creator shall be written using the format %d .
339
340 NATTCH (a,o)
341 The number of processes attached to the associated shared memory
342 segment. This field shall be written using the format %d .
343
344 SEGSZ (a,b)
345 The size of the associated shared memory segment. This field
346 shall be written using the format %d .
347
348 CPID (a,p)
349 The process ID of the creator of the shared memory entry. This
350 field shall be written using the format %d .
351
352 LPID (a,p)
353 The process ID of the last process to attach or detach the
354 shared memory segment. This field shall be written using the
355 format:
356
357
358 "%d", <pid>
359
360 where <pid> is 0 if no process has attached the corresponding shared
361 memory segment; otherwise, <pid> shall be the process ID of the last
362 process to attach or detach the segment.
363
364 ATIME (a,t)
365 The time the last attach on the associated shared memory segment
366 was completed. If the corresponding shared memory segment has
367 ever been attached, the hour, minute, and second of the last
368 time the segment was attached shall be written using the format
369 %d : %2.2d : %2.2d . Otherwise, the format " no-entry" shall be
370 written.
371
372 DTIME (a,t)
373 The time the last detach on the associated shared memory segment
374 was completed. If the corresponding shared memory segment has
375 ever been detached, the hour, minute, and second of the last
376 time the segment was detached shall be written using the format
377 %d : %2.2d : %2.2d . Otherwise, the format " no-entry" shall be
378 written.
379
380
381 The following four columns shall be only written out for semaphore
382 sets:
383
384 CREATOR (a,c)
385 The user of the creator of the facility entry. If the user name
386 of the creator is found in the user database, at least the first
387 eight column positions of the name shall be written using the
388 format %s . Otherwise, the user ID of the creator shall be writ‐
389 ten using the format %d .
390
391 CGROUP (a,c)
392 The group name of the creator of the facility entry. If the
393 group name of the creator is found in the group database, at
394 least the first eight column positions of the name shall be
395 written using the format %s . Otherwise, the group ID of the
396 creator shall be written using the format %d .
397
398 NSEMS (a,b)
399 The number of semaphores in the set associated with the sema‐
400 phore entry. This field shall be written using the format %d .
401
402 OTIME (a,t)
403 The time the last semaphore operation on the set associated with
404 the semaphore entry was completed. If a semaphore operation has
405 ever been performed on the corresponding semaphore set, the
406 hour, minute, and second of the last semaphore operation on the
407 semaphore set shall be written using the format %d : %2.2d :
408 %2.2d . Otherwise, the format " no-entry" shall be written.
409
410
411 The following column shall be written for all three reports when it is
412 requested:
413
414 CTIME (a,t)
415 The time the associated entry was created or changed. The hour,
416 minute, and second of the time when the associated entry was
417 created shall be written using the format %d : %2.2d : %2.2d .
418
419
421 The standard error shall be used only for diagnostic messages.
422
424 None.
425
427 None.
428
430 The following exit values shall be returned:
431
432 0 Successful completion.
433
434 >0 An error occurred.
435
436
438 Default.
439
440 The following sections are informative.
441
443 Things can change while ipcs is running; the information it gives is
444 guaranteed to be accurate only when it was retrieved.
445
447 None.
448
450 None.
451
453 None.
454
456 The System Interfaces volume of IEEE Std 1003.1-2001, msgrcv(),
457 msgsnd(), semget(), semop(), shmat(), shmdt(), shmget()
458
460 Portions of this text are reprinted and reproduced in electronic form
461 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
462 -- Portable Operating System Interface (POSIX), The Open Group Base
463 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
464 Electrical and Electronics Engineers, Inc and The Open Group. In the
465 event of any discrepancy between this version and the original IEEE and
466 The Open Group Standard, the original IEEE and The Open Group Standard
467 is the referee document. The original Standard can be obtained online
468 at http://www.opengroup.org/unix/online.html .
469
470
471
472IEEE/The Open Group 2003 IPCS(P)