IPC::SysV - System V IPC constants and system calls
| Use Case | Command | Description |
|---|---|---|
| Get IPC key | ftok(PATH, ID) | Return a key based on PATH and ID for use with msgget, semget, shmget |
| Attach shared memory | shmat(ID, ADDR, FLAG) | Attach shared memory segment to address space |
| Detach shared memory | shmdt(ADDR) | Detach shared memory segment |
| Read from shared memory | memread(ADDR, VAR, POS, SIZE) | Read SIZE bytes from memory segment at ADDR |
| Write to shared memory | memwrite(ADDR, STRING, POS, SIZE) | Write SIZE bytes to memory segment at ADDR |
| Import IPC constants | use IPC::SysV qw(IPC_STAT IPC_PRIVATE); | Import constants for SysV IPC calls |
use IPC::SysV qw(IPC_STAT IPC_PRIVATE);
“IPC::SysV” defines and conditionally exports all the constants defined in your system include files which are needed by the SysV IPC calls. Common ones include:
IPC_CREATIPC_EXCLIPC_NOWAITIPC_PRIVATEIPC_RMIDIPC_SETIPC_STATGETVALSETVALGETPIDGETNCNTGETZCNTGETALLSETALLSEM_ASEM_RSEM_UNDOSHM_RDONLYSHM_RNDSHMLBAand auxiliary ones:
S_IRUSRS_IWUSRS_IRWXUS_IRGRPS_IWGRPS_IRWXGS_IROTHS_IWOTHS_IRWXObut your system might have more.
ftok( PATH )ftok( PATH, ID )Return a key based on PATH and ID, which can be used as a key for msgget, semget and shmget. See ftok(3).
If ID is omitted, it defaults to 1. If a single character is given for ID, the numeric value of that character is used.
shmat( ID, ADDR, FLAG )Attach the shared memory segment identified by ID to the address space of the calling process. See shmat(2).
ADDR should be undef unless you really know what you're doing.
shmdt( ADDR )Detach the shared memory segment located at the address specified by ADDR from the address space of the calling process. See shmdt(2).
memread( ADDR, VAR, POS, SIZE )Reads SIZE bytes from a memory segment at ADDR starting at position POS. VAR must be a variable that will hold the data read. Returns true if successful, or false if there is an error. memread() taints the variable.
memwrite( ADDR, STRING, POS, SIZE )Writes SIZE bytes from STRING to a memory segment at ADDR starting at position POS. If STRING is too long, only SIZE bytes are used; if STRING is too short, nulls are written to fill out SIZE bytes. Returns true if successful, or false if there is an error.
Graham Barr <gbarr AT pobox.com>, Jarkko Hietaniemi <jhi AT iki.fi>, Marcus Holland-Moritz <mhx AT cpan.org>
Version 2.x, Copyright (C) 2007-2013, Marcus Holland-Moritz.
Version 1.x, Copyright (c) 1997, Graham Barr.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-22 01:01 @2600:1f28:365:80b0:d8a5:c3c6:bf94:28c0
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format