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 utility shall  conform  to  the  Base  Definitions  volume  of
28       POSIX.1‐2017, 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       If -q, -m, or -s are specified, only information about those facilities
39       shall be written. If none of these  three  are  specified,  information
40       about all three shall be written subject to the following options:
41
42       -a        Use  all print options. (This is a shorthand notation for -b,
43                 -c, -o, -p, and -t.)
44
45       -b        Write information on maximum allowable size. (Maximum  number
46                 of  bytes  in  messages  on queue for message queues, size of
47                 segments for shared memory, and number of semaphores in  each
48                 set for semaphores.)
49
50       -c        Write creator's user name and group name; see below.
51
52       -o        Write  information  on outstanding usage. (Number of messages
53                 on queue and total number of bytes in messages on  queue  for
54                 message  queues,  and  number of processes attached to shared
55                 memory segments.)
56
57       -p        Write process number information. (Process  ID  of  the  last
58                 process  to send a message and process ID of the last process
59                 to receive a message on message queues,  process  ID  of  the
60                 creating  process,  and  process  ID  of  the last process to
61                 attach or detach on shared memory segments.)
62
63       -t        Write time information. (Time of the last  control  operation
64                 that  changed the access permissions for all facilities, time
65                 of the last  msgsnd()  and  msgrcv()  operations  on  message
66                 queues,  time  of  the last shmat() and shmdt() operations on
67                 shared memory, and time of the last semop() operation on sem‐
68                 aphores.)
69

OPERANDS

71       None.
72

STDIN

74       Not used.
75

INPUT FILES

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

ENVIRONMENT VARIABLES

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

ASYNCHRONOUS EVENTS

110       Default.
111

STDOUT

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

STDERR

399       The standard error shall be used only for diagnostic messages.
400

OUTPUT FILES

402       None.
403

EXTENDED DESCRIPTION

405       None.
406

EXIT STATUS

408       The following exit values shall be returned:
409
410        0    Successful completion.
411
412       >0    An error occurred.
413

CONSEQUENCES OF ERRORS

415       Default.
416
417       The following sections are informative.
418

APPLICATION USAGE

420       Things  can  change  while ipcs is running; the information it gives is
421       guaranteed to be accurate only when it was retrieved.
422

EXAMPLES

424       None.
425

RATIONALE

427       None.
428

FUTURE DIRECTIONS

430       None.
431

SEE ALSO

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