IPC::SysV(3pm)
π IPC::SysV π
okay so bestie, you're reading the IPC::SysV(3pm) page from the Perl Programmers Reference Guide β and honestly? it's a whole vibe. it's all about System V IPC constants and system calls, and i'm gonna walk you through it like we're texting at 2am π¦
β¨ NAME β¨
IPC::SysV β System V IPC constants and system calls. that's it, that's the whole personality π
π SYNOPSIS π
like, the bare minimum to get you started:
use IPC::SysV qw(IPC_STAT IPC_PRIVATE);
literally one line and you're in, no cap β¨
πΈ DESCRIPTION πΈ
IPC::SysV defines β and conditionally exports β all the constants that live in your system's include files that the SysV IPC calls need. not some of them. all the ones it can find. obsessed π«Ά
the common ones include:
IPC_CREAT IPC_EXCL IPC_NOWAIT IPC_PRIVATE IPC_RMID IPC_SET IPC_STAT
GETVAL SETVAL GETPID GETNCNT GETZCNT GETALL SETALL
SEM_A SEM_R SEM_UNDO
SHM_RDONLY SHM_RND SHMLBA
and then the auxiliary ones, aka the supporting cast that also ate:
S_IRUSR S_IWUSR S_IRWXU
S_IRGRP S_IWGRP S_IRWXG
S_IROTH S_IWOTH S_IRWXO
but fr fr β your system might have more. every system's got its own extras, iykyk π
π§ the functions π§
β ftok( PATH ) / ftok( PATH, ID )
returns a key based on PATH and ID, and you can use that key for msgget, semget and shmget. see ftok(3) for the deets.
if ID is omitted, it defaults to 1 β cute little default, love that for us. and if you pass a single character for ID, the numeric value of that character is what gets used π
β shmat( ID, ADDR, FLAG )
attaches the shared memory segment identified by ID to the address space of the calling process. see shmat(2).
bestie pls βADDRshould beundefunless you really know what you're doing. like, genuinely. no cap. this is the "i have years of experience" part of the manpage π
β shmdt( ADDR )
detaches the shared memory segment sitting at the address specified by ADDR from the address space of the calling process. see shmdt(2). it's the goodbye function, and honestly it's giving closure β¨
β memread( ADDR, VAR, POS, SIZE )
reads SIZE bytes from a memory segment at ADDR, starting at position POS. VAR has to be a variable that will hold the data that gets read. returns true if it worked, false if there's an error. also, heads up: 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
STRINGis too long β onlySIZEbytes are used βοΈ - if
STRINGis too short β nulls get written to fill out the fullSIZEbytes π«§
returns true if it worked, false if there's an error. consistent queen π
π¦ SEE ALSO π¦
the whole friend group:
go follow them, they're iconic π
π AUTHORS π
the legends themselves:
- Graham Barr
<gbarr@pobox.com> - Jarkko Hietaniemi
<jhi@iki.fi> - Marcus Holland-Moritz
<mhx@cpan.org>
we stan all three, fr fr π«Ά
π COPYRIGHT π
- 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. legal queen behavior π
and that's the whole page!! okay bye bestie, this was perl v5.42.3 dated 2026-11-03, from the IPC::SysV(3pm) page itself β mwah, ilysm, go write some shared memory code πβ¨πΈ
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms