relay_reserve(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ relay_reserve(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so you're in the <pink>Kernel API Manual</pink>, section 9, and the star of the show is relay_reserve β€” yes that's the whole name, no cap ✨

πŸ’– NAME πŸ’–

relay_reserve β€” reserve a slot in the channel buffer 🫢 like grabbing your seat before the group chat descends, except it's bytes and it's kernel land

🌸 SYNOPSIS 🌸

void * relay_reserve (struct rchan *chan , size_t length );

literally that's it, that's the whole vibe check πŸ’…

πŸ¦‹ ARGUMENTS πŸ¦‹

  • chan β€” the relay channel πŸ’œ your main character struct, the one holding the buffer
  • length β€” number of bytes to reserve πŸŽ€ how much room you're claiming, in bytes, exactly

✨ DESCRIPTION ✨

Returns a pointer to the reserved slot, and NULL if it's full 😭 so pls check that return value, i'm begging

What it actually does: it reserves a slot in the <cyan>current cpu's</cyan> channel buffer πŸ”₯ current CPU, not some other one, keep that in mind bestie

⚠️ and here's the important part πŸ‘‘ it does not protect the buffer at all β€” the caller has to provide the appropriate synchronization. that's on you, not on it. no cap, it will not save you πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./include/linux/relay.h πŸ“ plus these iconic siblings:


and that's the whole page, periodt 🧚 from ./include/linux, October 2026 β€” mwah, go reserve some slots responsibly, iykyk πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from