Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ipcs - inter-process communication status

&pagelevel(4)&pagelevel

ipcs prints information about active inter-process communication facilities (IPC facilities).

You can specify options to control

  • the type of IPC facilities for which information is to be displayed

  • what information is to be shown.

Since the states of IPC facilities may change while ipcs is running, the displayed information is only current at the time of the request.


Syntax


ipcs [ option]...

No option specified

ipcs prints information in short format for

  • message queues

  • shared memory

  • semaphores

that are currently active in the system. The meanings of individual output columns are described in the section “Output”.


option

There are options for defining the type of IPC facility and options for defining the type of information.

Defining the type of IPC facility

-q

(message queues)

Prints information about active message queues.

-m

(memory)

Prints information about active shared memory.

-s

(semaphores)

Prints information about active semaphores.

If the -q, -m or -s option is set, only information about the corresponding IPC facility is shown. Any combination of these options is possible. If none of the options are specified, information on all types of IPC facilities will be displayed.

Defining the type of information

The following section describes the options that select the type of information to be provided for the IPC facilities specified by the -q, -m and -s options. See the “Output” for the meaning of the individual output columns.

-a

(all)

Sets all options that print various types of information. This is a shorthand notation for -b, -c, -o, -p and -t.

-A

(all)

Like option -a, but time information is printed with date and time (format yyyy-mm-yy_hh:mm:ss). This is a shorthand notation for -b, -c, -o, -p and -T.

-b

(biggest)

Prints the biggest allowable size for each respective IPC facility:

  • For message queues: the maximum number of bytes in a message to be placed on the queue.

  • For shared memory: the size of the memory segments.

  • For semaphores: the number of semaphores in each set of semaphores.

-c

(creator)

Prints the user ID (login name) and group name of the creator of the IPC facility.

-o

(outstanding)

Prints information on outstanding IPC facilities, including:

  • the number of messages on queue

  • the total number of bytes in messages on queue

  • the number of processes attached to a shared memory segment.

-p

(process)

Prints process number information, including:

  • the process ID of the last process that sent a message

  • the process ID of the last process that received a message

  • the process ID of the process that created a shared memory segment

  • the process ID of the last process that used a shared memory segment
    (attach, detach).

-t

(time)

Prints time information. The time of the last control operation that changed the access permissions for all IPC facilities is displayed:

  • For message queues: time when the system call msgrcv() [4] (receive message from queue) or msgsnd() [4] (send message to queue) was last used.

  • For shared memory: time when the system call shmat() [4] or shmdt() [4] was last used.

  • For semaphores: time when the system call semop() [4] was last used on a semaphore.

-T

(time)

Prints time information like option -t, but with date and time (format yyyy-mm-yy_hh:mm:ss).

Output

The column headings and the meanings of the columns in an ipcs listing are given below. The letters in parentheses (...) indicate the options which cause the corresponding heading to appear. all means that the heading always appears.

CBYTES (a,o)

The number of bytes in messages currently outstanding on the associated message queue.

CGROUP (a,c)

The group name to which the creator of the IPC facility belongs.

CREATOR (a,c)

The user ID (login name) of the creator of the IPC facility entry.

CTIME (a,t)

The time when the associated entry was created or changed.

GROUP (all)

The group name of the group to which the owner of the IPC facility belongs.

ID (all)

The identifier for the IPC facility.

KEY (all)

The key used as an argument when creating the IPC facility with msgget() (create message queue) or semget() (create semaphore set).

LRPID (a,p)

The process ID of the last process to receive a message from the associated queue.

LSPID (a,p)

The process ID of the last process to send a message to the associated queue.

MODE (all)

The IPC facility access modes and status indicators. The mode consists of
11 characters that are interpreted as follows:

The first character is:


Sif a process is waiting on a msgsnd()

D

if the shared memory segment in question was detached. The character disappears when the shared memory segment is detached by the last process that was attached to it.

-if a process is not waiting on a msgsnd().


The second character is:


Rif a process is waiting on a msgrcv()

C

if the shared memory segment is cleared on executing the first attach.

-if a process is not waiting on a msgrcv().


The next 9 characters are interpreted as three sets of three bits each:

  • The first set refers to the access permissions of the owner of the IPC facility.

  • The second set represents the access permissions of others belonging to the same user group as the owner of the IPC facility entry.

  • The third group refers to the access permissions of all other users.

Within each set, the first character indicates permission to read, the second character indicates permission to write or alter the IPC facility entry, and the last character is currently unused.

The permissions are specified as follows:


r if read permission is granted
w if write permission is granted

a

if permission to alter the IPC facility entry is granted

-if the indicated permission is not granted.


NSEMS (a,b)

The number of semaphores in the associated semaphore set.

OTIME (a,t)

The time the last semaphore operation was completed on the associated semaphore set.

OWNER (all)

The user ID (login name) of the owner of the IPC facility entry.

QBYTES (a,b)

The maximum number of bytes allowed in messages outstanding on the associated message queue.

QNUM (a,o)

The number of messages currently outstanding on the associated message queue.

RTIME (a,t)

The time the last message was received from the associated message queue.

STIME (a,t)

The time the last message was sent to the associated message queue.

NATTCH (a,o)

The number of processes attached to the shared memory segment involved.

SEGSZ (a,b)

The size of the shared memory segment involved.

CPID (a,p)

The process ID of the process that created the shared memory segment.

LPID (a,p)

The process ID of the last process that used a shared memory segment (attach,
detach).

ATIME (a,t)

The time at which the last attach on the shared memory segment involved was
completed.

DTIME (a,t)

The time at which the last detach on a shared memory segment was completed.

T (all)

Type of IPC facility:


qstands for message queue
mstands for shared memory

s

stands for semaphore.

File

/etc/group

The /etc/group file contains a list of all created group names.

Example

The server program sets up a message queue. You first start this program in the background and then check the status of the inter-process communication facilities with ipcs:

$ server &
$ ipcs

IPC status from /dev/kmem as of Mon Mar 09 08:40:41 2009

T     ID     KEY        MODE       OWNER    GROUP
Message Queues:

q     40  0x0000004b -Rrw-rw-rw-  user1   usrother

Shared Memory:

Semaphores:

See also

ipcrm
msgctl(), msgget(), semctl(), semget(), semop(), shmctl() [4]