ipcs — Report status of the interprocess communication facility

Format

ipcs [–mqsS] [–a b c o p t w x y M B]

Description

ipcs writes to the standard output information for active interprocess communication facilities. If you do not specify any flags, ipcs writes information in a short form about currently active message queues, shared memory segments, and semaphores.

The column headings and the meaning of the columns in an ipcs command listing are listed in Table 1. . The letters in parentheses indicate the command flags that cause the corresponding heading to appear. (all) means that the heading is always displayed. These flags determine what information is provided for each facility. They do not determine which facilities are listed.

Table 1. Explanation of the ipcs command listing
Column heading Meaning of the column
T (all except y) The type of facility:
  • q: Message queue
  • m: Shared memory segment
  • s: Semaphore
  • S: Map Memory Service
ID (all except x,w,y,S,B) The identifier for the facility entry
KEY (all except y,S,B) The key used as a parameter to the msgget subroutine, the semget subroutine, or the shmget subroutine to make the facility entry. (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 it.)
MODE (all except x,w,y,S,B) 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 in a msgrcv() system call.
S
If a process is waiting in 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.
The next nine characters are interpreted as three sets of three characters 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, except S,B) The login name or user ID of the owner of the facility entry.
GROUP (all) The name or group ID of the group that owns the facility entry.
CREATOR (a,c) The login name or user ID of the creator of the facility entry.
CGROUP (a,c) The group name or group ID of the creator of the facility entry.
CBYTES (a,x,o) The number of bytes in messages currently outstanding on the associated message queue.
INFO (x) Provides additional extended state information. Under this field will be returned one or more of the following codes (codes are not mutually exclusive unless noted):
For shared memory output:
M
megaroo
For semaphore output:
P
PLO in use. Mutually exclusive with L.
L
Latch in use. Mutually exclusive with P.
B
Binary semaphore.
For message queue output:
P
PLO in use. Mutually exclusive with L.
L
Latch in use. Mutually exclusive with P.
R
RCV type PID.
S
Send type PID.
1
PLO1 flag on––IPC_PLO1 set on msgget()
2
PLO2 flag on––IPC_PLO2 set on msgget()
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 (p) The ID of the last process that sent a message to the associated queue.
LRPID (p) The ID of the last process that received a message from the associated queue.
STIME (a,t) The time when the last message was sent to the associated queue.
RTIME (a,t) The time when the last message was received from the associated queue.
CTIME (a,t) The time when the associated entry was created or changed.
NATTCH (a,o) The number of processes attached to the associated shared memory segment.
SEGSZPG (a,b,x) The size in pages of the associated shared memory segment.
PGSZ (a,b,x) The page size of the associated shared memory segment.
SEGSZ (a,b,x) The size in bytes of the associated shared memory segment.
CPID (p) The process ID of the creator of the shared memory entry.
LPID (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.
RCVWAIT (x) A count of msgrcv() waiters.
SNDWAIT (x) A count of msgsnd() waiters.
MSGQPID (w) For the message Q report, up to 10 lines of data will be shown under this heading.
MSGQTYPE (w) For the message Q report, up to 10 lines of data will be shown under this heading.
RCVPID (w) The process ID of a msgrcv() waiter. A maximum of 10 process IDs can be written.
RCVTYP (w) The message type of a msgrcv() waiter associated with RCVPID. A maximum of 10 message type will be written. If the caller does not have read access, this field is not displayed.
SNDPID (w) The process ID of a msgsnd() waiter. A maximum of 10 process IDs can be written
SNDLEN (w) The message send length of a msgsnd() waiter associated with SNDPID. A maximum of 10 message send lengths can be written.
TERMA (x) The number of times sem_val was changed during termination for semaphore adjustments.
CNADJ (x) The current number of processes with semaphore adjustments.
SNCNT (x) The number of waiters waiting for a sem_val greater than zero.
SZCNT (x) The number of waiters waiting for a sem_val equal to zero.
WTRPID (w) The process IDs of a semop waiter. A maximum of 10 semop waiters are written.
WTRNM (w) The semaphore number associated with WTRPID. A maximum of 10 semaphore numbers are written.
WTROP (w) The semaphore operation value associated with WTRNM and WTRPID. A maximum of 10 semaphore operation values are written.
AJPID (w) The process ID of a process with semaphore adjustments. A maximum of 10 process IDs are written.
AJNUM (w) The semaphore number of the semaphore adjustment associated with AJPID. A maximum of 10 semaphore numbers are written.
AJPID (w) The process ID of a process with semaphore adjustments. A maximum of 10 process IDs are written.
AJNUM (w) The semaphore number of the semaphore adjustments associated with AJPID. A maximum of 10 semaphore numbers are written.
AJVAL (w) The semaphore adjustment value associated with AJNUM and AJPID. A maximum of 10 semaphore adjustment values are written.
ATPID (x) The process ID of a process that is attached to this shared memory segment. A maximum of 10 process IDs are written.
ATADDR (x) The shared memory address where the process ATPID is attached to this segment. A maximum of 10 addresses are written.
MNIDS (y) The system limit for maximum number of message queues, semaphores, or shared memory IDs.
HWIDS (y) The most message queues, semaphores, or shared memory IDs created.
CIDSA (y) The current number of message queues, semaphores, or shared memory IDs available.
CPRIV (y) The current number of message queues, semaphores, or shared memory IDs created with IPC_PRIVATE
CKEY (y) The current number of message queues, semaphores, or shared memory IDs created with a key.
GETEX (y) The number of times msgget, semget, or shmget exceeded the maximum number of IDs MNID.
MAXQB (y) The system limit for maximum number of bytes on a message queue.
QMNUM (y) The system limit for maximum number messages on a message queue.
ENOMEM (y) The number of times msgsnd() calls returned ENOMEM.
MNSEMS (y) The system limit for maximum number of semaphores per set.
MNOPS (y) The system limit for maximum number of operations per semop.
CSBYTES (y) The current number of bytes used by the system for semaphores.
TPAGES (y) The system limit for number of system-wide shared memory pages
SPAGES (y) The system limit for number of pages per shared memory segment.
SEGPR (y) The system limit for number of segments per process.
CPAGES (y) The current number of system-wide shared memory pages
MAXSEG (y) The largest number of shared memory pages allocated to a single shared memory segment.
CREATEPID (S,B) The creator PID of the map memory area. It is an unique identifier of the map area.
USERPID (S,B) The user PID of the map memory area, which is currently using it.
USER (S,B) The user name of the user of the map memory segments entry.
SHUTDOWN (S,B) This field indicates that for this particular map memory object, shutdown flag has been marked for freeing of this area. While blocks can be freed in this area, the map memory object is not freed until the last process using it terminates.
BLKSIZE (B) The block size of the map area object in megabytes.
BLKSINUSE (B) The number of blocks is in use in the map memory area object.
BLKSINMAP (B) The number of blocks in this map area object.
BLKSMAPPED (B) The number of blocks mapped by this process.
SECLABEL (M) The multilevel security label associated with Message queues, Semaphores, and Shared Memory.

Options

–q
Writes information about active message queues.
–m
Writes information about active shared memory segments.
–s
Writes information about active semaphore set.
–S
Write information about active __map memory segments.

If –q, –m, –s, or –S are specified, only information about those facilities is written. If none of these four are specified, information about message queues, shared memory segments and semaphores are written subject to the following options. __Map memory information will not written unless the –S is specified.

–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. This option will be ignored for __map memory option [–S].
–c
Writes the login name and group name of the user that made the facility. This option will be ignored for __map memory option [–S].
–m
Writes information about active shared memory segments.
–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 the following:
  • Process number of the last process to receive a message on message queues
  • Process number of the creating process
  • Process number of last process to attach or detach on shared memory segments
–q
Writes information about active message queues.
–s
Writes information about active semaphore set.
–t
  • 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
–w
Writes message queue wait status and semaphore adjustment status in these fields:
Fields
AJNUM KEY RCVPID T  
AJPID MSGQPID RCVTYP WTRNM  
AJVAL MSGQTYP SNDLEN WTROP  
GROUP OWNER SNDPID WTRPID  
This option ignores all other print options except –x and –y.
–x
Writes extended status in these fields:
Fields
ATADDR KEY SEGSZ T  
ATPID OWNER SEGSZPG TERMA  
CNADJ PGSZ SNCNT    
GROUP QCBYTES SNDWAIT    
INFO RCVWAIT SZCNT    
This option will be ignored for __map memory option [–S]. This option ignores all other print options except the –y option.
–y
Writes summary and system limit status in these fields:
Fields
CIDSA ENOMEM MAXSEG SPAGES  
CKEY GETEX MNIDS TPAGES  
CPAGES HWIDS MNOPS    
CPRIV QMNUM MNSEMS    
CSBYTES MAXQB SEGPR    
This option ignores all other print options. This option is a summary and system limit status for message queues, semaphores and shared memory. It will not include the __map memory segments [–S] summary and system limit status.
–M
Writes the multilevel security label associated with the resources except the __map memory facility. See z/OS Planning for Multilevel Security and the Common Criteria for more information about multilevel security.
–B
Writes extended information about __map memory segments in these fields: BLKSIZE, BLKSINUSE, BLKSINMAP, and BLKSMAPPED. This option only applies to __map memory segments [–S].

Examples

Following is a sample output from entering ipcs without flags:
  IPC status as of Wed Apr  6 14:56:22 EDT 1994
    Message Queues:
    T         ID     KEY        MODE       OWNER    GROUP
    q 1234567890 0x4107001c -Rrw-rw----     root   printq
    Shared Memory:
    T         ID     KEY        MODE       OWNER    GROUP
    m          0 0x0d07021e --rw-------     root   system
    m          1 0x0d08c984 --rw-rw-rw-     root   system
    Semaphores:
    T         ID     KEY        MODE       OWNER    GROUP
    s       4096 0x0108c86e --ra-------     root   system
    s          1 0x6208c8ef --ra-r--r--     root   system
    s          2 0x4d0b00a6 --ra-ra----     root   system
    s      24579 0x00bc614e --ra-ra-ra-     xlin   vendor
    s     176132 0x00000058 --ra-ra-ra-     xlin   vendor
Following is a sample output from entering ipcs -S:
IPC status as of Wed Oct 6 14:56:22 EDT 2002
    Map Memory Service:
  T    CREATEPID   USERPID      USER     GROUP     SHUTDOWN
  S      1096       165         root    system         Y
  S         4       114         John    system         Y	
  S         6       324         John    system	       N
  S      1052       111       Andrew    vendor	       N	
  S        96       678         xlin    vendor	       Y  

Exit values

0
Successful completion
1
Failure due to incorrect command-line option

Related information

ipcrm