System Interface Guide

POSIX IPC

POSIX interprocess communication is a variation of System V interprocess communication. It is new in Solaris 7:w. Like System V objects, POSIX IPC object have read and write (but not execute) permissions for the owner, the owner's group, and for others. There is no way for the owner of a POSIX IPC object to assign a different owner.

Unlike the System V IPC interfaces, the POSIX IPC interfaces are all multithread safe.

POSIX Messages

The POSIX message queue interfaces are:

mq_open(3R)

Connects to, and optionally creates, a named message queue. 

mq_close(3R)

Ends the connection to an open message queue. 

mq_unlink(3R)

Ends the connection to an open message queue and causes the queue to be removed when the last process closes it. 

mq_send(3R)

Places a message in the queue. 

mq_receive(3R)

Receives (removes) the oldest, highest priority message from the queue. 

mq_notify(3R)

Notifies a process or thread that a message is available in the queue. 

mq_setattr(3R), mq_getattr(3R)

Set or get message queue attributes. 

POSIX Semaphores

POSIX semaphores are much lighter weight than are System V semaphores. A POSIX semaphore structure defines a single semaphore, not an array of up to twenty five semaphores.

The POSIX semaphore interfaces are

sem_open(3R)

Connects to, and optionally creates, a named semaphore; 

sem_init(3R)

Initializes a semaphore structure (internal to the calling program, so not a named semaphore). 

sem_close(3R)

Ends the connection to an open semaphore. 

sem_unlink(3R)

Ends the connection to an open semaphore and causes the semaphore to be removed when the last process closes it. 

sem_destroy(3R)

Initializes a semaphore structure (internal to the calling program, so not a named semaphore). 

sem_getvalue(3R)

Copies the value of the semaphore into the specified integer. 

sem_wait(3R), sem_trywait(3R)

Blocks while the semaphore is held by other processes or returns an error if the semaphore is held by another process. 

sem_post(3R)

Increments the count of the semaphore. 

POSIX Shared Memory

POSIX shared memory is actually a variation of mapped memory (see "Creating and Using Mappings"). The major differences are to use shm_open(3R) to open the shared memory object (instead of calling open(2)) and use shm_unlink(3R) to close and delete the object (instead of calling close(2) which does not remove the object). The options in shm_open(3R) are substantially fewer than the number of options provided in open(2).