newseg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 newseg(9) 🌸

okay bestie, welcome to the Kernel API Manual β€” yes, the Kernel API Manual, we're in the big leagues now πŸ’… this one's short and sweet but it's lowkey important, so pay attention 🫢


✨ NAME ✨

newseg β€” it literally creates a new shared memory segment, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

int newseg (struct ipc_namespace *ns , struct ipc_params *params );

that's it. that's the whole call. two args, one int coming back at you, iconic πŸ’–


✨ ARGUMENTS ✨

  • ns β€” the namespace, bestie. that's the struct ipc_namespace * right there 🌈
  • params β€” a ptr to the structure that contains key, size and shmflg β€” like, all three of them live in there, so hand over the pointer and let the function do its thing πŸ¦‹

✨ DESCRIPTION ✨

okay so here's the one thing you cannot skip, and I mean it, no cap:

Called with shm_ids.rwsem held as a writer. πŸ”₯

like, you gotta already be holding it as a writer before this runs β€” that's the contract, that's the vibe check, don't come in without it 😭 it's giving "read the room before you walk in" energy fr fr.


✨ SEE ALSO ✨

  • Kernel file ./ipc/shm.c β€” go read it, it's the main character of this whole story πŸ‘‘

and that's the page!! short, sweet, slays πŸ’€βœ¨

signing off with the deets so you have them forever: this one lives under ./ipc, dated October 2026, and the header up top is newseg(9) with the Kernel API Manual energy all over it πŸŽ€ bye bestie, go hold that rwsem as a writer πŸ’œ

πŸ“¦ where this page comes from