Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ipcmk

Create System V IPC resources.

Synopsis

ipcmk -M <size>     # create shared memory segment
ipcmk -Q            # create message queue
ipcmk -S <nsems>    # create semaphore array

Operation

Creates System V IPC resources using shmget(2), msgget(2), or semget(2) with IPC_PRIVATE as the key (guaranteeing a new unique resource).

Syscalls

SyscallFlagDescription
shmget(IPC_PRIVATE, size, IPC_CREAT | mode)-MCreate shared memory
msgget(IPC_PRIVATE, IPC_CREAT | mode)-QCreate message queue
semget(IPC_PRIVATE, nsems, IPC_CREAT | mode)-SCreate semaphore array

Command-line options

OptionDescription
-M, --shmem <size>Create shared memory segment of given size
-Q, --queueCreate message queue
-S, --semaphore <N>Create semaphore array with N elements
-p, --mode <mode>Permissions in octal (default: 0644)
-h, --helpDisplay help
-V, --versionDisplay version

Exit codes

CodeMeaning
0Success
1Failure

Not yet implemented

  • POSIX IPC (-m, -q, -s with -n name)
  • Size suffix parsing (KiB, MiB, GiB)