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
11

NAME

13       ipcs — report XSI interprocess communication facilities status
14

SYNOPSIS

16       ipcs [−qms] [−a|−bcopt]
17

DESCRIPTION

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

OPTIONS

28       The ipcs utility shall  conform  to  the  Base  Definitions  volume  of
29       POSIX.1‐2008, Section 12.2, Utility Syntax Guidelines.
30
31       The ipcs utility accepts the following options:
32
33       −q        Write information about active message queues.
34
35       −m        Write information about active shared memory segments.
36
37       −s        Write information about active semaphore sets.
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,
44                 −c, −o, −p, and −t.)
45
46       −b        Write information on maximum allowable size. (Maximum  number
47                 of  bytes  in  messages  on queue for message queues, size of
48                 segments for shared memory, and number of semaphores in  each
49                 set for semaphores.)
50
51       −c        Write creator's user name and group name; see below.
52
53       −o        Write  information  on outstanding usage. (Number of messages
54                 on queue and total number of bytes in messages on  queue  for
55                 message  queues,  and  number of processes attached to shared
56                 memory segments.)
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
60                 to receive a message on message queues,  process  ID  of  the
61                 creating  process,  and  process  ID  of  the last process to
62                 attach or detach on shared memory segments.)
63
64       −t        Write time information. (Time of the last  control  operation
65                 that  changed the access permissions for all facilities, time
66                 of the last  msgsnd()  and  msgrcv()  operations  on  message
67                 queues,  time  of  the last shmat() and shmdt() operations on
68                 shared memory, and time of the last semop() operation on sem‐
69                 aphores.)
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 vari‐
86                 ables that are unset or null. (See the Base Definitions  vol‐
87                 ume  of POSIX.1‐2008, Section 8.2, Internationalization Vari‐
88                 ables for the precedence  of  internationalization  variables
89                 used to determine the values of locale categories.)
90
91       LC_ALL    If  set  to  a non-empty string value, override the values of
92                 all the other internationalization variables.
93
94       LC_CTYPE  Determine the locale for the interpretation of  sequences  of
95                 bytes of text data as characters (for example, single-byte as
96                 opposed to multi-byte characters in arguments).
97
98       LC_MESSAGES
99                 Determine the locale that should be used to affect the format
100                 and  contents  of  diagnostic  messages  written  to standard
101                 error.
102
103       NLSPATH   Determine the location of message catalogs for the processing
104                 of LC_MESSAGES.
105
106       TZ        Determine  the timezone for the date and time strings written
107                 by ipcs.  If TZ is unset  or  null,  an  unspecified  default
108                 timezone shall be used.
109

ASYNCHRONOUS EVENTS

111       Default.
112

STDOUT

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

STDERR

394       The standard error shall be used only for diagnostic messages.
395

OUTPUT FILES

397       None.
398

EXTENDED DESCRIPTION

400       None.
401

EXIT STATUS

403       The following exit values shall be returned:
404
405        0    Successful completion.
406
407       >0    An error occurred.
408

CONSEQUENCES OF ERRORS

410       Default.
411
412       The following sections are informative.
413

APPLICATION USAGE

415       Things  can  change  while ipcs is running; the information it gives is
416       guaranteed to be accurate only when it was retrieved.
417

EXAMPLES

419       None.
420

RATIONALE

422       None.
423

FUTURE DIRECTIONS

425       None.
426

SEE ALSO

428       ipcrm
429
430       The Base Definitions volume of  POSIX.1‐2008,  Chapter  8,  Environment
431       Variables, Section 12.2, Utility Syntax Guidelines
432
433       The  System  Interfaces  volume  of  POSIX.1‐2008,  msgrcv(), msgsnd(),
434       semget(), semop(), shmat(), shmdt(), shmget()
435
437       Portions of this text are reprinted and reproduced in  electronic  form
438       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
439       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
440       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
441       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
442       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
443       event of any discrepancy between this version and the original IEEE and
444       The  Open Group Standard, the original IEEE and The Open Group Standard
445       is the referee document. The original Standard can be  obtained  online
446       at http://www.unix.org/online.html .
447
448       Any  typographical  or  formatting  errors that appear in this page are
449       most likely to have been introduced during the conversion of the source
450       files  to  man page format. To report such errors, see https://www.ker
451       nel.org/doc/man-pages/reporting_bugs.html .
452
453
454
455IEEE/The Open Group                  2013                             IPCS(1P)
Impressum