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 β€” ADDR should be undef unless 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 STRING is too long β†’ only SIZE bytes are used βœ‚οΈ
  • if STRING is too short β†’ nulls get written to fill out the full SIZE bytes 🫧

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 🫢


  • 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