.TH ipcs "" "" Command
.PC "Display a snapshot of interprocess communications"
.\"\fBipcs [\-abcmopst] \fB[\-C \fImemorydevice\^\fB] [\-N \fIkernel\^\fB]\fR
\fBipcs [\-abcmopst] [\-N \fIkernel\^\fB]\fR
.PP
.HS
.SH Options:
.IP \fB\-a\fR 0.3i
Use all print options
.IP \fB\-b\fR 0.3i 
Display the biggest size that the kernel allows for each kind of IPC object
.\".IP "\fB\-C \fIcorefile\fR"
.\"Read memory from \fImemorydevice\fR
.\"instead of from device \fB/dev/kmem\fR
.IP \fB\-c\fR
Display login name and group name of the user who created each IPC object
.IP \fB\-m\fR
Display information about shared-memory segments
.IP "\fB\-N \fIkernel\fR"
Read kernel-specific information from \fIkernel\fR
instead of from the default kernel \fB/autoboot\fR
.IP \fB\-o\fR
Display ``outstanding usage''
.IP \fB\-p\fR
Display process identifiers
.IP \fB\-q\fR
Display information about message queues
.IP \fB\-s\fR
Display information about sets of semaphores
.IP \fB\-t\fR
Display the times that each IPC was last used and modified
.HE
The command
.B ipcs
prints information about interprocess communication (IPC) objects.
.SH Options
.B ipcs
recognizes the following command-line options:
.\".IP \fB\-A\fR 0.3i
.\"Displays the ACL's associated with the requested IPC
.\"objects.
.IP \fB\-a\fR 0.3i
``All'' print option; i.e., combine the options
.BR \-b ,
.BR \-c ,
.BR \-o ,
.BR \-p ,
and
.BR \-t .
.IP \fB\-b\fR 0.3i 
``Biggest'' option:
Display the maximum size that the kernel allows for each kind of IPC object.
.\".IP "\fB\-C \fImemorydevice\fR"
.\"Read memory from device
.\".I memorydevice
.\"instead of from device
.\".BR /dev/kmem .
.IP \fB\-c\fR
Display the login name and group name of the user who created each IPC object.
.IP \fB\-m\fR
Display information about shared-memory segments.
By default,
.B ipcs
displays information about all IPC objects.
.IP "\fB\-N \fIkernel\fR"
Read kernel-specific information from
.I kernel
instead of from the default kernel
.BR /autoboot .
.IP \fB\-o\fR
``Outstanding usage'' option:
Display the number of messages currently queued and their total size in bytes,
and the number of processes attached to each shared-memory segment.
.IP \fB\-p\fR
Display the process identifiers of the following:
.RS
.IP \(bu 0.3i
The last process to send a message.
.IS \(bu
The last process to receive a message on each message queue.
.IS \(bu
Each creating process.
.IS \(bu
The last process to attach to or detach from each shared-memory segment.
.RE
.IP \fB\-q\fR 0.3i
Display information about message queues.
By default,
.B ipcs
displays information about all IPC objects.
.IP \fB\-s\fR
Display information about sets of semaphores.
By default,
.B ipcs
displays information about all IPC objects.
.IP \fB\-t\fR
Display the following information about times:
.RS
.IP \(bu 0.3i
When functions
.B msgsnd()
and
.B msgrcv()
were last executed for each message queue.
.IP \(bu
When the functions
.B shmat()
and
.B shmdt()
were last executed for each shared-memory segment.
.IP \(bu
When the function
.B semop()
was last executed for each set of semaphores.
.SH "Format of Displayed Information"
The following names and describes each column of information that
.B ipcs
can display for each IPC object.
The letters in parentheses name the command-line options tell
.B ipcs
to display this column;
.B all
means that
.B ipcs
always displays this column:
.IP "\fBATIME\fR (\fB\-at\fR)"
The last time a process attached itself to this shared-memory segment.
.IP "\fBCBYTES\fR (\fB\-ao\fR)"
The total number of bytes in this message queue.
.IP "\fBCGROUP\fR (\fB\-ac\fR)"
The name of the group to which the creator of this IPC object belongs.
.IP "\fBCPID\fR (\fB\-ap\fR)"
The identifier of the process that created this shared-memory segment.
.IP "\fBCREATOR\fR (\fB\-ac\fR)"
The login identifier of the user who created this IPC object.
.IP "\fBCTIME\fR (\fB\-at\fR)"
The time when this IPC object was created or last changed.
.IP "\fBDTIME\fR (\fB\-at\fR)"
The most recent time a process detached itself from this shared-memory segment.
.IP "\fBGROUP\fR (\fBall\fR)"
The name of the group to which the owner of this IPC object belongs.
.IP "\fBID\fR (\fBall\fR)"
The numeric identifier of this IPC object.
.IP "\fBKEY\fR (\fBall\fR)"
The key that names this IPC object.
Applications use this key to identify and manipulate the IPC object.
.\"(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.)
.IP "\fBLPID\fR (\fB\-ap\fR)"
The identifier of the last process to have attached itself to or detached
itself from this shared-memory segment.
.IP "\fBLRPID\fR (\fB\-ap\fR)"
The identifier of the last process to have received a message
from this message queue.
.IP "\fBLSPID\fR (\fB\-ap\fR)"
The identifier of the last process to have sent a message to this
message queue.
.IP "\fBMODE\fR (\fBall\fR)"
The IPC object's mode.
The mode is a string of 11 characters that interprets the value of field
.B mode
in the structure
.BR ipc_perm ,
which is part of each IPC object.
(For more information on this structure, see the Lexicon entries
.BR msgget() ,
.BR semget() ,
and
.BR shmget() .)
The first two mode characters are as follows:
.RS
.IP \fBR\fR 0.3i
A process is waiting for \fBmsgrcv()\fR.
.IS \fBS\fR
A process is waiting for \fBmsgsnd()\fR.
.IS \fBD\fR
The associated shared-memory segment has been removed.
.IS \fBC\fR
The associated shared-memory segment will be cleared when the first process
attaches itself to it.
.IS \fB\-\fR
The corresponding flag is not set.
.RE
.IP
The last nine characters of the mode give the permissions on the IPC
object \(em three sets of three characters each.
In each set,
the first character marks whether read permission is granted,
the second whether permission to write or alter is granted,
and the third is unused.
The first set gives the permissions of the user who created the object
(its ``owner'');
the second, the permissions of other users in the owner's group;
and the third, the permissions of all other users.
.IP "\fBNATTCH\fR (\fB\-ao\fR)"
The number of processes attached to this shared-memory segment.
.IP "\fBNSEMS\fR (\fB\-ab\fR)"
The number of semaphores in this set.
.IP "\fBOTIME\fR (\fB\at\fR)"
The last time a semaphore operation was completed on this set.
.IP "\fBOWNER\fR (\fBall\fR)"
The login identifier of the user who ``owns'' this IPC object.
.IP "\fBQBYTES\fR (\fB\-ab\fR)"
The number of bytes left available to the messages in this queue.
.IP "\fBQNUM\fR (\fB\-ao\fR)"
The number of messages in this queue.
.IP "\fBRTIME\fR (\fB\-at\fR)"
The last time a message was received from this queue.
.IP "\fBSEGSZ\fR (\fB\-ab\fR)"
The size of this shared-memory segment.
.IP "\fBSTIME\fR (\fB\-at\fR)"
The last time a message was sent to this queue.
.IP "\fBT\fR (\fBall\fR)"
The type of IPC object this is, as follows:
.DS
	\fBm\fR	Shared-memory segment
	\fBq\fR	Message queue
	\fBs\fR	Set of semaphores
.DE
.SH "See Also"
.Xr "commands," commands
.Xr "ipcrm," ipcrm
.Xr "msgget()," msgget
.Xr "semget()," semget
.Xr "shmget()" shmget
.SH Notes
.B ipcs
gives information about the way interprocess communications are at the
moment you run it.
The data it returns can change even as you read them.
.\" .PP
.\" If you use either of the flags
.\" .B \-C
.\" or
.\" .BR \-N ,
.\" .B ipcs
.\" sets the real and effective user and group identifiers to you.
