ipcs Command
Purpose
Reports interprocess communication facility status.
Syntax
ipcs [ -m] [ -q] [ -s] [ -S] [ -P] [ -l] [ -a | -b -c -o -p -r -t] [ -T] [ -C CoreFile]
[ -N Kernel ] [ -X ]
Description
The ipcs command writes to the standard output information about active interprocess
communication facilities. If you do not specify any flags, the ipcs command writes
information in a short form about currently active message queues, shared memory
segments, semaphores, remote queues, and local queue headers.
The column headings and the meaning of the columns in an ipcs command listing follow.
The letters in parentheses indicate the flags that cause the corresponding heading to
appear. The designator all means the heading is always displayed. These flags only
determine what information is provided for each facility. They do not determine which
facilities are listed.
T
(all) the type of facility. There are three facility types:
q
message queue
m
shared memory segment
s
semaphore
ID
(all) the identifier for the facility entry.
KEY
(all) the key used as a parameter to the msgget subroutine, the semget subroutine,
or the shmget subroutine to make the facility entry.
Note: The key of a shared memory segment is changed to IPC_PRIVATE when the segment
is removed until all processes attached to the segment detach from it.
MODE
(all) the facility access modes and flags. The mode consists of 11 characters that
are interpreted as follows:
The first two characters can be the following:
R
If a process is waiting on a msgrcv system call.
S
If a process is waiting on a msgsnd system call.
D
If the associated shared memory segment has been removed. It disappears when
the last process attached to the segment detaches it.
C
If the associated shared memory segment is to be cleared when the first
attach is run.
-
If the corresponding special flag is not set.
The next nine characters are interpreted as three sets of 3 bits each. The first
set refers to the owner's permissions; the next to permissions of others in the
user group 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
currently unused.
The permissions are indicated as follows:
r
If read permission is granted.
w
If write permission is granted.
a
If alter permission is granted.
-
If the indicated permission is not granted.
OWNER
(all) The login name of the owner of the facility entry.
GROUP
(all) The name of the group that owns the facility entry.
CREATOR
(a,c) The login name of the creator of the facility entry.
CGROUP
(a,c) The group name of the creator of the facility entry.
Note: For the OWNER, GROUP, CREATOR, and CGROUP, the user and group IDs display
instead of the login names.
CBYTES
(a,o) The number of bytes in messages currently outstanding on the associated
message queue.
QNUM
(a,o) The number of messages currently outstanding on the associated message queue.
QBYTES
(a,b) The maximum number of bytes allowed in messages outstanding on the associated
message queue.
LSPID
(a,p) The ID of the last process that sent a message to the associated queue. If
the last message sent was from a process in a node other than the node that holds
the queue, LSPID is the PID of the kernel process that actually placed the message
on the queue, not the PID of the sending process.
LRPID
(a,p) The ID of the last process that received a message from the associated queue.
If the last message received was from a process in a node other than the node that
holds the queue, LRPID is the PID of the kernel process that actually received the
message on the queue, not the PID of the receiving process.
STIME
(a,t) The time when the last message was sent to the associated queue. For remote
queues, this is the server time. No attempt is made to compensate for time-zone
differences between the local clock and the server clock.
RTIME
(a,t) The time when the last message was received from the associated queue. For
remote queues, this is the server time. No attempt is made to compensate for any
time-zone differences between the local clock and the server clock.
CTIME
(a,t) The time when the associated entry was created or changed. For remote queues,
this is the server time. No attempt is made to compensate for any time-zone
differences between the local clock and the server clock.
NATTCH
(a,o) The number of processes attached to the associated shared memory segment.
SEGSZ
(a,b) The size of the associated shared memory segment.
CPID
(a,p) The process ID of the creator of the shared memory entry.
LPID
(a,p) The process ID of the last process to attach or detach the shared memory
segment.
ATIME
(a,t) The time when the last attach was completed to the associated shared memory
segment.
DTIME
(a,t) The time the last detach was completed on the associated shared memory
segment.
NSEMS
(a,b) The number of semaphores in the set associated with the semaphore entry.
OTIME
(a,t) The time the last semaphore operation was completed on the set associated
with the semaphore entry.
SID
(S) The shared memory segment id. SIDs can be used as input to the svmon -S
command.
RTFLAGS
(r) Filled with UNLINK when the real-time interprocess communication object has
been unlinked. Otherwise, a hyphen (-) is displayed.
NAME
(r) The name of the real-time interprocess communication object. A hyphen (-) is
displayed for the unnamed semaphores.
This command supports multibyte character sets.
Flags
-a
Uses the -b, -c, -o, -p and -t flags.
-b
Writes the maximum number of bytes in messages on queue for message queues, the
size of segments for shared memory, and the number of semaphores in each semaphores
set.
-c
Writes the login name and group name of the user that made the facility.
-CCoreFile
Uses the file specified by the CoreFile parameter in place of the /dev/mem file.
The CoreFile parameter is a memory image file produced by the Ctrl-(left)Alt-Pad1
key sequence.
-l
When used with the -S flag, this flag writes the list of SIDs unwrapped.
-m
Writes information about active shared memory segments.
-NKernel
Uses the specified Kernel (the /usr/lib/boot/unix file is the default).
-o
Writes the following usage information:
* Number of messages on queue
* Total number of bytes in messages in queue for message queues
* Number of processes attached to shared memory segments
-p
Writes process number information:
* Process number of the last process to receive a message on message queues
* Process number of last process to send a message on message queues
* Process number of the creating process
* Process number of last process to attach or detach on shared memory segments
-P
Writes the list of SIDs (segment IDs) associated with the shared memory ID, along
with the number of bytes pinned to that segment and an indication of whether the
segment is large-page enabled or not. If the segment is large-page enabled, a 'Y'
is displayed, otherwise a '-' is displayed.
-q
Writes information about active message queues.
-r
Writes information about real-time interprocess communication objects.
-s
Writes information about active semaphore set.
-S
Writes the list of SID attached to shared memory id.
-t
Writes time information:
* Time of the last control operation that changed the access permissions for
all facilities
* Time of the last msgsnd and msgrcv on message queues
* Time of the last shmat and shmdt on shared memory
* Time of the last semop on semaphore sets
-T
Writes the output of the -t flag with the date.
-X
Prints all available characters of each user name, group name of owner, creator,
owner group, creator group instead of truncating to the first 8 characters. Notes:
1 If the user specifies either the -C or -N flag, the real and effective UID/GID is
set to the real UID/GID of the user invoking ipcs.
2 Values can change while ipcs is running; the information it gives is guaranteed to
be accurate only when it was retrieved.
Example
Example output from entering ipcs without flags:
IPC status from /dev/mem as of Mon Aug 14 15:03:46 1989
T ID KEY MODE OWNER GROUP
Message Queues:
q 0 0x00010381 -Rrw-rw-rw- root system
q 65537 0x00010307 -Rrw-rw-rw- root system
q 65538 0x00010311 -Rrw-rw-rw- root system
q 65539 0x0001032f -Rrw-rw-rw- root system
q 65540 0x0001031b -Rrw-rw-rw- root system
q 65541 0x00010339--rw-rw-rw- root system
q 6 0x0002fe03 -Rrw-rw-rw- root system
Shared Memory:
m 65537 0x00000000 DCrw------- root system
m 720898 0x00010300 -Crw-rw-rw- root system
m 65539 0x00000000 DCrw------- root system
Semaphores:
s 131072 0x4d02086a --ra-ra---- root system
s 65537 0x00000000 --ra------- root system
s 1310722 0x000133d0 --ra------- 7003 30720
Files
/usr/lib/boot/unix
Specifies the system kernel image.
/dev/mem
Specifies memory.
/etc/passwd
Specifies user names.
/etc/group
Specifies group names.
/usr/include/sys/ipc.h
Contains the header file.
Related Information
The ipcrm command.
The svmon command.
The msgrcv subroutine, msgsnd subroutine, semop subroutine, shmat subroutine, shmdt
subroutine.
Commands in Operating system and device management.