summaryrefslogtreecommitdiffstats
path: root/man-pages-posix-2013/man1p/ipcs.1p
blob: 54456e9e66dbb601e1e891461efa37a140fe4a07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
'\" et
.TH IPCS "1P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.

.SH NAME
ipcs
\(em report XSI interprocess communication facilities status
.SH SYNOPSIS
.LP
.nf
ipcs \fB[\fR\(miqms\fB] [\fR\(mia|\(mibcopt\fB]\fR
.fi
.SH DESCRIPTION
The
.IR ipcs
utility shall write information about active interprocess communication
facilities.
.P
Without options, information shall be written in short format for
message queues, shared memory segments, and semaphore sets that are
currently active in the system. Otherwise, the information that is
displayed is controlled by the options specified.
.SH OPTIONS
The
.IR ipcs
utility shall conform to the Base Definitions volume of POSIX.1\(hy2008,
.IR "Section 12.2" ", " "Utility Syntax Guidelines".
.P
The
.IR ipcs
utility accepts the following options:
.IP "\fB\(miq\fP" 10
Write information about active message queues.
.IP "\fB\(mim\fP" 10
Write information about active shared memory segments.
.IP "\fB\(mis\fP" 10
Write information about active semaphore sets.
.P
If
.BR \(miq ,
.BR \(mim ,
or
.BR \(mis
are specified, only information about those facilities shall be
written. If none of these three are specified, information about all
three shall be written subject to the following options:
.IP "\fB\(mia\fP" 10
Use all print options. (This is a shorthand notation for
.BR \(mib ,
.BR \(mic ,
.BR \(mio ,
.BR \(mip ,
and
.BR \(mit .)
.IP "\fB\(mib\fP" 10
Write information on maximum allowable size. (Maximum number of bytes
in messages on queue for message queues, size of segments for shared
memory, and number of semaphores in each set for semaphores.)
.IP "\fB\(mic\fP" 10
Write creator's user name and group name; see below.
.IP "\fB\(mio\fP" 10
Write information on outstanding usage. (Number of messages on queue
and total number of bytes in messages on queue for message queues, and
number of processes attached to shared memory segments.)
.IP "\fB\(mip\fP" 10
Write process number information. (Process ID of the last process to
send a message and process ID of the last process to receive a message
on message queues, process ID of the creating process, and process ID
of the last process to attach or detach on shared memory segments.)
.IP "\fB\(mit\fP" 10
Write time information. (Time of the last control operation that
changed the access permissions for all facilities, time of the last
\fImsgsnd\fR()
and
\fImsgrcv\fR()
operations on message queues, time of the last
\fIshmat\fR()
and
\fIshmdt\fR()
operations on shared memory, and time of the last
\fIsemop\fR()
operation on semaphores.)
.SH OPERANDS
None.
.SH STDIN
Not used.
.SH "INPUT FILES"
.IP " *" 4
The group database
.IP " *" 4
The user database
.SH "ENVIRONMENT VARIABLES"
The following environment variables shall affect the execution of
.IR ipcs :
.IP "\fILANG\fP" 10
Provide a default value for the internationalization variables that are
unset or null. (See the Base Definitions volume of POSIX.1\(hy2008,
.IR "Section 8.2" ", " "Internationalization Variables"
for the precedence of internationalization variables used to determine
the values of locale categories.)
.IP "\fILC_ALL\fP" 10
If set to a non-empty string value, override the values of all the
other internationalization variables.
.IP "\fILC_CTYPE\fP" 10
Determine the locale for the interpretation of sequences of bytes of
text data as characters (for example, single-byte as opposed to
multi-byte characters in arguments).
.IP "\fILC_MESSAGES\fP" 10
.br
Determine the locale that should be used to affect the format and
contents of diagnostic messages written to standard error.
.IP "\fINLSPATH\fP" 10
Determine the location of message catalogs for the processing of
.IR LC_MESSAGES .
.IP "\fITZ\fP" 10
Determine the timezone for the date and time strings written by
.IR ipcs .
If
.IR TZ
is unset or null, an unspecified default timezone shall be used.
.SH "ASYNCHRONOUS EVENTS"
Default.
.SH STDOUT
An introductory line shall be written with the format:
.sp
.RS 4
.nf
\fB
"IPC status from %s as of %s\en", <\fIsource\fP>, <\fIdate\fP>
.fi \fR
.P
.RE
.P
where <\fIsource\fP> indicates the source used to gather the statistics
and <\fIdate\fP> is the information that would be produced by the
.IR date
command when invoked in the POSIX locale.
.P
The
.IR ipcs
utility then shall create up to three reports depending upon the
.BR \(miq ,
.BR \(mim ,
and
.BR \(mis
options. The first report shall indicate the status of message queues,
the second report shall indicate the status of shared memory segments,
and the third report shall indicate the status of semaphore sets.
.P
If the corresponding facility is not installed or has not been used
since the last reboot, then the report shall be written out in the
format:
.sp
.RS 4
.nf
\fB
"%s facility not in system.\en", <\fIfacility\fP>
.fi \fR
.P
.RE
.P
where <\fIfacility\fP> is
.IR "Message Queue" ,
.IR "Shared Memory" ,
or
.IR "Semaphore" ,
as appropriate. If the facility has been installed and has been used
since the last reboot, column headings separated by one or more
<space>
characters and followed by a
<newline>
shall be written as indicated below followed by the facility name
written out using the format:
.sp
.RS 4
.nf
\fB
"%s:\en", <\fIfacility\fP>
.fi \fR
.P
.RE
.P
where <\fIfacility\fP> is
.IR "Message Queues" ,
.IR "Shared Memory" ,
or
.IR "Semaphores" ,
as appropriate. On the second and third reports the column headings
need not be written if the last column headings written already provide
column headings for all information in that report.
.P
The column headings provided in the first column below and the meaning
of the information in those columns shall be given in order below; the
letters in parentheses indicate the options that shall cause the
corresponding column to appear; ``all'' means that the column shall
always appear. Each column is separated by one or more
<space>
characters. Note that these options only determine what information is
provided for each report; they do not determine which reports are written.
.IP "T (all)" 12
Type of facility:
.RS 12 
.IP "\fRq\fP" 8
Message queue.
.IP "\fRm\fP" 8
Shared memory segment.
.IP "\fRs\fP" 8
Semaphore.
.P
This field is a single character written using the format
.BR %c .
.RE
.IP "ID (all)" 12
The identifier for the facility entry. This field shall be written
using the format
.BR %d .
.IP "KEY (all)" 12
The key used as an argument to
\fImsgget\fR(),
\fIsemget\fR(),
or
\fIshmget\fR()
to create the facility entry.
.RS 12 
.TP 10
.BR Note:
The key of a shared memory segment is changed to IPC_PRIVATE when the
segment has been removed until all processes attached to the segment
detach it.
.P
This field shall be written using the format \fR0x%x\fR.
.RE
.IP "MODE (all)" 12
The facility access modes and flags. The mode shall consist of 11
characters that are interpreted as follows.
.RS 12 
.P
The first character shall be:
.IP "\fRS\fP" 8
If a process is waiting on a
\fImsgsnd\fR()
operation.
.IP "\fR\(mi\fP" 8
If the above is not true.
.P
The second character shall be:
.IP "\fRR\fP" 8
If a process is waiting on a
\fImsgrcv\fR()
operation.
.IP "\fRC\fP\ or\ \fR\(mi\fP" 8
If the associated shared memory segment is to be cleared when the first
attach operation is executed.
.IP "\fR\(mi\fP" 8
If none of the above is true.
.P
The next nine characters shall be interpreted as three sets of three
bits each. The first set refers to the owner's permissions; the next
to permissions of others in the usergroup of the facility entry; and
the last to all others. Within each set, the first character indicates
permission to read, the second character indicates permission to write
or alter the facility entry, and the last character is a minus-sign (\c
.BR '\(mi' ).
.P
The permissions shall be indicated as follows:
.IP "\fIr\fP" 8
If read permission is granted.
.IP "\fIw\fP" 8
If write permission is granted.
.IP "\fIa\fP" 8
If alter permission is granted.
.IP "\fR\(mi\fP" 8
If the indicated permission is not granted.
.P
The first character following the permissions specifies if there is an
alternate or additional access control method associated with the
facility. If there is no alternate or additional access control method
associated with the facility, a single
<space>
shall be written; otherwise, another printable character is
written.
.RE
.IP "OWNER (all)" 12
The user name of the owner of the facility entry. If the user name of
the owner is found in the user database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the user ID of the owner shall be written using the format
.BR %d .
.IP "GROUP (all)" 12
The group name of the owner of the facility entry. If the group name
of the owner is found in the group database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the group ID of the owner shall be written using the format
.BR %d .
.P
The following nine columns shall be only written out for message
queues:
.IP "CREATOR (\fBa\fP,\fBc\fP)" 12
The user name of the creator of the facility entry. If the user name
of the creator is found in the user database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the user ID of the creator shall be written using the format
.BR %d .
.IP "CGROUP (\fBa\fP,\fBc\fP)" 12
The group name of the creator of the facility entry. If the group name
of the creator is found in the group database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the group ID of the creator shall be written using the format
.BR %d .
.IP "CBYTES (\fBa\fP,\fBo\fP)" 12
The number of bytes in messages currently outstanding on the associated
message queue. This field shall be written using the format
.BR %d .
.IP "QNUM (\fBa\fP,\fBo\fP)" 12
The number of messages currently outstanding on the associated message
queue. This field shall be written using the format
.BR %d .
.IP "QBYTES (\fBa\fP,\fBb\fP)" 12
The maximum number of bytes allowed in messages outstanding on the
associated message queue. This field shall be written using the format
.BR %d .
.IP "LSPID (\fBa\fP,\fBp\fP)" 12
The process ID of the last process to send a message to the associated
queue. This field shall be written using the format:
.RS 12 
.sp
.RS 4
.nf
\fB
"%d", <\fIpid\fP>
.fi \fR
.P
.RE
.P
where <\fIpid\fP> is 0 if no message has been sent to the corresponding
message queue; otherwise, <\fIpid\fP> shall be the process ID of the
last process to send a message to the queue.
.RE
.IP "LRPID (\fBa\fP,\fBp\fP)" 12
The process ID of the last process to receive a message from the
associated queue. This field shall be written using the format:
.RS 12 
.sp
.RS 4
.nf
\fB
"%d", <\fIpid\fP>
.fi \fR
.P
.RE
.P
where <\fIpid\fP> is 0 if no message has been received from the
corresponding message queue; otherwise, <\fIpid\fP> shall be the
process ID of the last process to receive a message from the queue.
.RE
.IP "STIME (\fBa\fP,\fBt\fP)" 12
The time the last message was sent to the associated queue.
If a message has been sent to the corresponding message queue,
the hour, minute, and second of the last time a message
was sent to the queue shall be written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
Otherwise, the format
.BR \(dq\ no-entry\(dq 
shall be written.
.IP "RTIME (\fBa\fP,\fBt\fP)" 12
The time the last message was received from the associated queue.
If a message has been received from the corresponding message queue,
the hour, minute, and second of the last time a message was received
from the queue shall be written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
Otherwise, the format
.BR \(dq\ no-entry\(dq 
shall be written.
.P
The following eight columns shall be only written out for shared memory
segments.
.IP "CREATOR (\fBa\fP,\fBc\fP)" 12
The user of the creator of the facility entry. If the user name of the
creator is found in the user database, at least the first eight column
positions of the name shall be written using the format
.BR %s .
Otherwise, the user ID of the creator shall be written using the format
.BR %d .
.IP "CGROUP (\fBa\fP,\fBc\fP)" 12
The group name of the creator of the facility entry. If the group name
of the creator is found in the group database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the group ID of the creator shall be written using the format
.BR %d .
.IP "NATTCH (\fBa\fP,\fBo\fP)" 12
The number of processes attached to the associated shared memory
segment. This field shall be written using the format
.BR %d .
.IP "SEGSZ (\fBa\fP,\fBb\fP)" 12
The size of the associated shared memory segment. This field shall be
written using the format
.BR %d .
.IP "CPID (\fBa\fP,\fBp\fP)" 12
The process ID of the creator of the shared memory entry. This field
shall be written using the format
.BR %d .
.IP "LPID (\fBa\fP,\fBp\fP)" 12
The process ID of the last process to attach or detach the shared
memory segment. This field shall be written using the format:
.RS 12 
.sp
.RS 4
.nf
\fB
"%d", <\fIpid\fP>
.fi \fR
.P
.RE
.P
where <\fIpid\fP> is 0 if no process has attached the corresponding
shared memory segment; otherwise, <\fIpid\fP> shall be the process ID
of the last process to attach or detach the segment.
.RE
.IP "ATIME (\fBa\fP,\fBt\fP)" 12
The time the last attach on the associated shared memory segment was
completed. If the corresponding shared memory segment has ever been
attached, the hour, minute, and second of the last time the segment was
attached shall be written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
Otherwise, the format
.BR \(dq\ no-entry\(dq 
shall be written.
.IP "DTIME (\fBa\fP,\fBt\fP)" 12
The time the last detach on the associated shared memory segment was
completed. If the corresponding shared memory segment has ever been
detached, the hour, minute, and second of the last time the segment was
detached shall be written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
Otherwise, the format
.BR \(dq\ no-entry\(dq 
shall be written.
.P
The following four columns shall be only written out for semaphore
sets:
.IP "CREATOR (\fBa\fP,\fBc\fP)" 12
The user of the creator of the facility entry. If the user name of the
creator is found in the user database, at least the first eight column
positions of the name shall be written using the format
.BR %s .
Otherwise, the user ID of the creator shall be written using the format
.BR %d .
.IP "CGROUP     (\fBa\fP,\fBc\fP)" 12
The group name of the creator of the facility entry. If the group name
of the creator is found in the group database, at least the first eight
column positions of the name shall be written using the format
.BR %s .
Otherwise, the group ID of the creator shall be written using the
format
.BR %d .
.IP "NSEMS (\fBa\fP,\fBb\fP)" 12
The number of semaphores in the set associated with the semaphore
entry. This field shall be written using the format
.BR %d .
.IP "OTIME (\fBa\fP,\fBt\fP)" 12
The time the last semaphore operation on the set associated with the
semaphore entry was completed. If a semaphore operation has ever been
performed on the corresponding semaphore set, the hour, minute, and
second of the last semaphore operation on the semaphore set shall be
written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
Otherwise, the format
.BR \(dq\ no-entry\(dq 
shall be written.
.P
The following column shall be written for all three reports when it is
requested:
.IP "CTIME (\fBa\fP,\fBt\fP)" 12
The time the associated entry was created or changed. The hour,
minute, and second of the time when the associated entry was created
shall be written using the format
.BR %d :\c
.BR %2.2d :\c
.BR %2.2d .
.SH STDERR
The standard error shall be used only for diagnostic messages.
.SH "OUTPUT FILES"
None.
.SH "EXTENDED DESCRIPTION"
None.
.SH "EXIT STATUS"
The following exit values shall be returned:
.IP "\00" 6
Successful completion.
.IP >0 6
An error occurred.
.SH "CONSEQUENCES OF ERRORS"
Default.
.LP
.IR "The following sections are informative."
.SH "APPLICATION USAGE"
Things can change while
.IR ipcs
is running; the information it gives is guaranteed to be accurate
only when it was retrieved.
.SH EXAMPLES
None.
.SH RATIONALE
None.
.SH "FUTURE DIRECTIONS"
None.
.SH "SEE ALSO"
.IR "\fIipcrm\fR\^"
.P
The Base Definitions volume of POSIX.1\(hy2008,
.IR "Chapter 8" ", " "Environment Variables",
.IR "Section 12.2" ", " "Utility Syntax Guidelines"
.P
The System Interfaces volume of POSIX.1\(hy2008,
.IR "\fImsgrcv\fR\^(\|)",
.IR "\fImsgsnd\fR\^(\|)",
.IR "\fIsemget\fR\^(\|)",
.IR "\fIsemop\fR\^(\|)",
.IR "\fIshmat\fR\^(\|)",
.IR "\fIshmdt\fR\^(\|)",
.IR "\fIshmget\fR\^(\|)"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.unix.org/online.html .

Any typographical or formatting errors that appear
in this page are most likely
to have been introduced during the conversion of the source files to
man page format. To report such errors, see
https://www.kernel.org/doc/man-pages/reporting_bugs.html .