Skip to content

IPC API Reference

This section collects Linux IPC APIs used across the UNIX socket, FD passing, POSIX shared memory, POSIX message queue, and POSIX semaphore labs.

UNIX Domain Socket and FD Passing

API Purpose
socketpair Create a connected UNIX socket pair
sendmsg / recvmsg Send and receive data with ancillary data
SCM_RIGHTS Pass file descriptors between processes

POSIX Shared Memory

API Purpose
shm_open Open or create a POSIX shared memory object
ftruncate Set shared memory object size
mmap Map shared memory into process address space
munmap Unmap a memory mapping
shm_unlink Remove a shared memory object name

POSIX Message Queue

API Purpose
mq_open Open or create a POSIX message queue
mq_send / mq_receive Send and receive queue messages
mq_close / mq_unlink Close and remove message queues

POSIX Semaphore and Process-Shared Synchronization

API Purpose
sem_init Initialize unnamed POSIX semaphores
sem_wait / sem_post Wait and signal semaphores
sem_destroy Destroy unnamed semaphores
Process-shared pthread sync Use pthread mutex/cond across processes