1IPCS(1P)                   POSIX Programmer's Manual                  IPCS(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       ipcs - report XSI interprocess communication facilities status
13

SYNOPSIS

15       ipcs [-qms][-a | -bcopt]
16

DESCRIPTION

18       The ipcs utility shall write information about active interprocess com‐
19       munication facilities.
20
21       Without  options, information shall be written in short format for mes‐
22       sage queues, shared memory segments, and semaphore sets that  are  cur‐
23       rently  active  in  the system. Otherwise, the information that is dis‐
24       played is controlled by the options specified.
25

OPTIONS

27       The  ipcs  facility   supports   the   Base   Definitions   volume   of
28       IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
29
30       The ipcs utility accepts the following options:
31
32       -q     Write information about active message queues.
33
34       -m     Write information about active shared memory segments.
35
36       -s     Write information about active semaphore sets.
37
38
39       If -q, -m, or -s are specified, only information about those facilities
40       shall be written. If none of these  three  are  specified,  information
41       about all three shall be written subject to the following options:
42
43       -a     Use all print options. (This is a shorthand notation for -b, -c,
44              -o, -p, and -t.)
45
46       -b     Write information on maximum allowable size. (Maximum number  of
47              bytes  in messages on queue for message queues, size of segments
48              for shared memory, and number of semaphores in each set for sem‐
49              aphores.)
50
51       -c     Write creator's user name and group name; see below.
52
53       -o     Write  information  on outstanding usage. (Number of messages on
54              queue and total number of bytes in messages on queue for message
55              queues,  and  number of processes attached to shared memory seg‐
56              ments.)
57
58       -p     Write process  number  information.  (Process  ID  of  the  last
59              process  to send a message and process ID of the last process to
60              receive a message on message queues, process ID of the  creating
61              process,  and process ID of the last process to attach or detach
62              on shared memory segments.)
63
64       -t     Write time information. (Time of the last control operation that
65              changed  the  access permissions for all facilities, time of the
66              last msgsnd() and msgrcv() operations on message queues, time of
67              the  last  shmat()  and shmdt() operations on shared memory, and
68              time of the last semop() operation on semaphores.)
69
70

OPERANDS

72       None.
73

STDIN

75       Not used.
76

INPUT FILES

78        * The group database
79
80        * The user database
81

ENVIRONMENT VARIABLES

83       The following environment variables shall affect the execution of ipcs:
84
85       LANG   Provide a default value for the  internationalization  variables
86              that  are  unset  or  null.  (See the Base Definitions volume of
87              IEEE Std 1003.1-2001, Section  8.2,  Internationalization  Vari‐
88              ables  for the precedence of internationalization variables used
89              to determine the values of locale categories.)
90
91       LC_ALL If set to a non-empty string value, override the values  of  all
92              the other internationalization variables.
93
94       LC_CTYPE
95              Determine  the  locale  for  the  interpretation of sequences of
96              bytes of text data as characters (for  example,  single-byte  as
97              opposed to multi-byte characters in arguments).
98
99       LC_MESSAGES
100              Determine  the  locale  that should be used to affect the format
101              and contents of diagnostic messages written to standard error.
102
103       NLSPATH
104              Determine the location of message catalogs for the processing of
105              LC_MESSAGES .
106
107       TZ     Determine  the timezone for the date and time strings written by
108              ipcs.  If TZ is unset or null, an unspecified  default  timezone
109              shall be used.
110
111

ASYNCHRONOUS EVENTS

113       Default.
114

STDOUT

116       An introductory line shall be written with the format:
117
118
119              "IPC status from %s as of %s\n", <source>, <date>
120
121       where  <source>  indicates the source used to gather the statistics and
122       <date> is the information that would be produced by  the  date  command
123       when invoked in the POSIX locale.
124
125       The  ipcs  utility then shall create up to three reports depending upon
126       the -q, -m, and -s options.  The first report shall indicate the status
127       of  message  queues,  the  second  report  shall indicate the status of
128       shared memory segments, and the third report shall indicate the  status
129       of semaphore sets.
130
131       If  the  corresponding  facility  is not installed or has not been used
132       since the last reboot, then the report shall be written out in the for‐
133       mat:
134
135
136              "%s facility not in system.\n", <facility>
137
138       where  <facility>  is  Message  Queue,  Shared Memory, or Semaphore, as
139       appropriate. If the facility has been installed and has been used since
140       the  last  reboot,  column headings separated by one or more spaces and
141       followed by a <newline> shall be written as indicated below followed by
142       the facility name written out using the format:
143
144
145              "%s:\n", <facility>
146
147       where  <facility>  is  Message Queues, Shared Memory, or Semaphores, as
148       appropriate. On the second and third reports the column  headings  need
149       not be written if the last column headings written already provide col‐
150       umn headings for all information in that report.
151
152       The column headings provided in the first column below and the  meaning
153       of  the information in those columns shall be given in order below; the
154       letters in parentheses indicate the options that shall cause the corre‐
155       sponding  column  to  appear;  "all" means that the column shall always
156       appear. Each column is separated by one or  more  <space>s.  Note  that
157       these  options  only  determine  what  information is provided for each
158       report; they do not determine which reports are written.
159
160       T (all)
161              Type of facility:
162
163       q
164              Message queue.
165
166       m
167              Shared memory segment.
168
169       s
170              Semaphore.
171
172
173       This field is a single character written using the format %c .
174
175       ID (all)
176              The identifier for the facility entry. This field shall be writ‐
177              ten using the format %d .
178
179       KEY (all)
180              The  key  used as an argument to msgget(), semget(), or shmget()
181              to create the facility entry.
182
183       Note:
184              The key of a shared memory segment  is  changed  to  IPC_PRIVATE
185              when  the  segment has been removed until all processes attached
186              to the segment detach it.
187
188       This field shall be written using the format 0x%x.
189
190       MODE (all)
191              The facility access modes and flags. The mode shall  consist  of
192              11 characters that are interpreted as follows.
193
194       The first character shall be:
195
196       S
197              If a process is waiting on a msgsnd() operation.
198
199       -
200              If the above is not true.
201
202
203       The second character shall be:
204
205       R
206              If a process is waiting on a msgrcv() operation.
207
208       C or -
209              If  the  associated  shared memory segment is to be cleared when
210              the first attach operation is executed.
211
212       -
213              If none of the above is true.
214
215
216       The next nine characters shall be interpreted as three  sets  of  three
217       bits each. The first set refers to the owner's permissions; the next to
218       permissions of others in the usergroup of the facility entry;  and  the
219       last to all others. Within each set, the first character indicates per‐
220       mission to read, the second character indicates permission to write  or
221       alter  the facility entry, and the last character is a minus sign ( '-'
222       ).
223
224       The permissions shall be indicated as follows:
225
226       r
227              If read permission is granted.
228
229       w
230              If write permission is granted.
231
232       a
233              If alter permission is granted.
234
235       -
236              If the indicated permission is not granted.
237
238
239       The first character following the permissions specifies if there is  an
240       alternate  or  additional  access  control  method  associated with the
241       facility. If there is no alternate or additional access control  method
242       associated with the facility, a single <space> shall be written; other‐
243       wise, another printable character is written.
244
245       OWNER (all)
246              The user name of the owner of the facility entry.  If  the  user
247              name  of  the  owner is found in the user database, at least the
248              first eight column positions of the name shall be written  using
249              the  format  %s  .  Otherwise, the user ID of the owner shall be
250              written using the format %d .
251
252       GROUP (all)
253              The group name of the owner of the facility entry. If the  group
254              name  of  the owner is found in the group database, at least the
255              first eight column positions of the name shall be written  using
256              the  format  %s  . Otherwise, the group ID of the owner shall be
257              written using the format %d .
258
259
260       The following nine columns  shall  be  only  written  out  for  message
261       queues:
262
263       CREATOR (a,c)
264              The  user name of the creator of the facility entry. If the user
265              name of the creator is found in the user database, at least  the
266              first  eight column positions of the name shall be written using
267              the format %s . Otherwise, the user ID of the creator  shall  be
268              written using the format %d .
269
270       CGROUP (a,c)
271              The  group  name  of  the  creator of the facility entry. If the
272              group name of the creator is found in  the  group  database,  at
273              least  the  first  eight  column  positions of the name shall be
274              written using the format %s . Otherwise, the  group  ID  of  the
275              creator shall be written using the format %d .
276
277       CBYTES (a,o)
278              The  number  of  bytes  in messages currently outstanding on the
279              associated message queue. This field shall be written using  the
280              format %d .
281
282       QNUM (a,o)
283              The  number  of messages currently outstanding on the associated
284              message queue. This field shall be written using the format %d .
285
286       QBYTES (a,b)
287              The maximum number of bytes allowed in messages  outstanding  on
288              the  associated message queue. This field shall be written using
289              the format %d .
290
291       LSPID (a,p)
292              The process ID of the last process to  send  a  message  to  the
293              associated queue. This field shall be written using the format:
294
295
296              "%d", <pid>
297
298       where  <pid> is 0 if no message has been sent to the corresponding mes‐
299       sage queue; otherwise, <pid> shall  be  the  process  ID  of  the  last
300       process to send a message to the queue.
301
302       LRPID (a,p)
303              The process ID of the last process to receive a message from the
304              associated queue. This field shall be written using the format:
305
306
307              "%d", <pid>
308
309       where <pid> is 0 if no message has been received from the corresponding
310       message  queue;  otherwise,  <pid>  shall be the process ID of the last
311       process to receive a message from the queue.
312
313       STIME (a,t)
314              The time the last message was sent to the associated queue. If a
315              message  has  been  sent to the corresponding message queue, the
316              hour, minute, and second of the last time a message was sent  to
317              the queue shall be written using the format %d : %2.2d : %2.2d .
318              Otherwise, the format " no-entry" shall be written.
319
320       RTIME (a,t)
321              The time the last  message  was  received  from  the  associated
322              queue.   If  a  message has been received from the corresponding
323              message queue, the hour, minute, and second of the last  time  a
324              message  was  received from the queue shall be written using the
325              format %d : %2.2d : %2.2d . Otherwise,  the  format  " no-entry"
326              shall be written.
327
328
329       The following eight columns shall be only written out for shared memory
330       segments.
331
332       CREATOR (a,c)
333              The user of the creator of the facility entry. If the user  name
334              of the creator is found in the user database, at least the first
335              eight column positions of the name shall be  written  using  the
336              format %s . Otherwise, the user ID of the creator shall be writ‐
337              ten using the format %d .
338
339       CGROUP (a,c)
340              The group name of the creator of  the  facility  entry.  If  the
341              group  name  of  the  creator is found in the group database, at
342              least the first eight column positions  of  the  name  shall  be
343              written  using  the  format  %s . Otherwise, the group ID of the
344              creator shall be written using the format %d .
345
346       NATTCH (a,o)
347              The number of processes attached to the associated shared memory
348              segment.  This field shall be written using the format %d .
349
350       SEGSZ (a,b)
351              The  size  of  the  associated shared memory segment. This field
352              shall be written using the format %d .
353
354       CPID (a,p)
355              The process ID of the creator of the shared memory  entry.  This
356              field shall be written using the format %d .
357
358       LPID (a,p)
359              The  process  ID  of  the  last  process to attach or detach the
360              shared memory segment. This field shall  be  written  using  the
361              format:
362
363
364              "%d", <pid>
365
366       where  <pid>  is  0 if no process has attached the corresponding shared
367       memory segment; otherwise, <pid> shall be the process ID  of  the  last
368       process to attach or detach the segment.
369
370       ATIME (a,t)
371              The time the last attach on the associated shared memory segment
372              was completed. If the corresponding shared  memory  segment  has
373              ever  been  attached,  the  hour, minute, and second of the last
374              time the segment was attached shall be written using the  format
375              %d  : %2.2d : %2.2d . Otherwise, the format " no-entry" shall be
376              written.
377
378       DTIME (a,t)
379              The time the last detach on the associated shared memory segment
380              was  completed.  If  the corresponding shared memory segment has
381              ever been detached, the hour, minute, and  second  of  the  last
382              time  the segment was detached shall be written using the format
383              %d : %2.2d : %2.2d . Otherwise, the format " no-entry" shall  be
384              written.
385
386
387       The  following  four  columns  shall  be only written out for semaphore
388       sets:
389
390       CREATOR (a,c)
391              The user of the creator of the facility entry. If the user  name
392              of the creator is found in the user database, at least the first
393              eight column positions of the name shall be  written  using  the
394              format %s . Otherwise, the user ID of the creator shall be writ‐
395              ten using the format %d .
396
397       CGROUP (a,c)
398              The group name of the creator of  the  facility  entry.  If  the
399              group  name  of  the  creator is found in the group database, at
400              least the first eight column positions  of  the  name  shall  be
401              written  using  the  format  %s . Otherwise, the group ID of the
402              creator shall be written using the format %d .
403
404       NSEMS (a,b)
405              The number of semaphores in the set associated  with  the  sema‐
406              phore entry. This field shall be written using the format %d .
407
408       OTIME (a,t)
409              The time the last semaphore operation on the set associated with
410              the semaphore entry was completed. If a semaphore operation  has
411              ever  been  performed  on  the  corresponding semaphore set, the
412              hour, minute, and second of the last semaphore operation on  the
413              semaphore  set  shall  be  written using the format %d : %2.2d :
414              %2.2d . Otherwise, the format " no-entry" shall be written.
415
416
417       The following column shall be written for all three reports when it  is
418       requested:
419
420       CTIME (a,t)
421              The  time the associated entry was created or changed. The hour,
422              minute, and second of the time when  the  associated  entry  was
423              created shall be written using the format %d : %2.2d : %2.2d .
424
425

STDERR

427       The standard error shall be used only for diagnostic messages.
428

OUTPUT FILES

430       None.
431

EXTENDED DESCRIPTION

433       None.
434

EXIT STATUS

436       The following exit values shall be returned:
437
438        0     Successful completion.
439
440       >0     An error occurred.
441
442

CONSEQUENCES OF ERRORS

444       Default.
445
446       The following sections are informative.
447

APPLICATION USAGE

449       Things  can  change  while ipcs is running; the information it gives is
450       guaranteed to be accurate only when it was retrieved.
451

EXAMPLES

453       None.
454

RATIONALE

456       None.
457

FUTURE DIRECTIONS

459       None.
460

SEE ALSO

462       The  System  Interfaces  volume  of   IEEE Std 1003.1-2001,   msgrcv(),
463       msgsnd(), semget(), semop(), shmat(), shmdt(), shmget()
464
466       Portions  of  this text are reprinted and reproduced in electronic form
467       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
468       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
469       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
470       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
471       event of any discrepancy between this version and the original IEEE and
472       The  Open Group Standard, the original IEEE and The Open Group Standard
473       is the referee document. The original Standard can be  obtained  online
474       at http://www.opengroup.org/unix/online.html .
475
476
477
478IEEE/The Open Group                  2003                             IPCS(1P)
Impressum