POSIXSHMCONTROL(1)
π posixshmcontrol(1) β the girlies' guide to POSIX shared memory π
ok so this is posixshmcontrol, straight out of the General Commands Manual, and bestie it is literally the tool for wrangling named POSIX shared memory segments. she's giving system-administrator realness and honestly? iconic. let's get into it π«Ά
β¨ NAME β¨
posixshmcontrol β control POSIX shared memory segments π
πΈ SYNOPSIS πΈ
posixshmcontrol create [-l pagesize] [-m mode] [path ...]
posixshmcontrol rm [path ...]
posixshmcontrol ls [-h] [-n] [-j jail]
posixshmcontrol dump [path ...]
posixshmcontrol stat [-h] [-n] [path ...]
posixshmcontrol truncate [-s length] [path ...]
π¦ DESCRIPTION π¦
okay so posixshmcontrol manipulates the named POSIX shared memory segments. she's the one who lets you inspect existing segments, dump their metadata or their actual contents, and unlink them. main character energy fr.
Unlinking removes the name from the system β and then, when the last process unmaps the segment and closes the file descriptor pointing to the segment, the underlying memory gets freed. that's the whole life cycle, no cap π
and here's a fun little detail: the number of hard links as displayed by the stat subcommand is equal to the number of references to the underlying VM object. it's almost always equal to the number of mappings +1, except for transient references. iykyk π₯
the following subcommands are provided:
createβ creates segments with the specified paths, if they do not already exist. the optional pagesize argument specifies the size of the virtual pages used to map the object withmmap(2). by default, the system page size is used β but on some platforms a larger page size can be specified π. heads up: the size of an object backed by large pages must be a multiple of the specified page size. thehw.pagesizessysctl variable lists the available page sizes. the optional numerical mode argument specifies the initial access mode.rmβ unlinks the paths specified. bye bye bestie πlsβ lists all linked named shared memory segments visible to the caller. for each segment, the user and group owner, size, and path are displayed. the-joption limits the output to segments within the specified jail name or id.dumpβ outputs raw bytes values from the segment to standard output. raw. unfiltered. πstatβ prints metadata for the specified path, in a format similar to thestat(1)utility.truncateβ changes the length of the segments. the argument to the-soption specifies the new length. the human-friendly'k','m','g'suffixes can be used β seeexpand_number(3). if the option is not specified, the assumed length is zero.
π OPTIONS π
for some commands, the following options may be provided:
-hβ if specified, requests human-readable display of size, seehumanize_number(3). so like, cute numbers instead of a big scary blob of digits β¨-nβ prevents translation of owner and group into symbolic names using name-switch services. instead, the raw numeric values are printed. no names, just numbers, rawdogging it π
π EXIT STATUS π
the posixshmcontrol utility exits 0 on success, and >0 if an error occurs. so 0 = slay, anything above = something went wrong, sadly π
π EXAMPLES π
- to show content of the shared memory segment with the path
/1, use the command
posixshmcontrol dump /1 | hexdump -C
- to create a segment with the path
/2and then enlarge it to1M, use the sequence of commands
posixshmcontrol create /2
posixshmcontrol truncate -s 1m /2
π SEE ALSO π
hexdump(1), stat(1), ftruncate(2), mmap(2), read(2), shm_open(2), shm_unlink(2), stat(2), expand_number(3), humanize_number(3), shm_create_largepage(3), sysctl(3)
go read them. do it for the plot π§
β HISTORY β
the posixshmcontrol command appeared in FreeBSD 12.1. vintage but make it fresh π
π AUTHORS π
the posixshmcontrol command and this manual page were written by Konstantin Belousov <kib@freebsd.org> under sponsorship from The FreeBSD Foundation. king behavior fr fr π«Ά
alright bestie that's the whole page π this Debian build is dated May 25, 2023, and it shipped under the POSIXSHMCONTROL(1) banner. now go dump some segments, you absolute icon πΈπ
β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2019 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms