relay_switch_subbuf(9)
π relay_switch_subbuf β like, the kernel API manual, but make it make sense
okay so bestie, welcome to relay_switch_subbuf(9) β yes it's a section 9 kernel API page, yes it's from the Kernel API Manual, and yes we're gonna get through it together π«Ά
β¨ NAME β¨
relay_switch_subbuf β switch to a new sub-buffer. that's literally the whole thing, no cap π
πΈ SYNOPSIS πΈ
size_t relay_switch_subbuf (struct rchan_buf *buf , size_t length );
like, that's the signature, character for character, don't @ me π
π¦ ARGUMENTS π¦
bufβ channel buffer. the buffer for the channel. she's the main character of this function ngl πlengthβ size of current event. as in, how big the event you're currently dealing with is πΈ
β DESCRIPTION β
So what does she do? She returns either the length you passed in, or 0 if full. that's it, that's the return contract, iykyk π
And the way she does it?? She performs sub-buffer-switch tasks β the little chores of switching over to a fresh sub-buffer β such as invoking callbacks, updating padding counts, waking up readers, etc. like she's doing the group project all by herself and honestly? slay π§β¨
fr fr remember:0means full.0is not a length, bestie, it's the "we're cooked" signal π
π SEE ALSO π
Kernel file ./kernel/relay.c β go read it, it's giving source of truth π
relay_mmap_prepare_buf(9)relay_alloc_buf(9)relay_create_buf(9)relay_destroy_channel(9)relay_destroy_buf(9)relay_remove_buf(9)relay_buf_empty(9)relay_buf_full(9)wakeup_readers(9)__relay_reset(9)relay_reset(9)relay_close_buf(9)relay_open(9)relay_subbufs_consumed(9)relay_close(9)relay_flush(9)relay_stats(9)relay_file_open(9)relay_file_mmap_prepare(9)relay_file_poll(9)relay_file_release(9)relay_file_read_subbuf_avail(9)relay_file_read_start_pos(9)relay_file_read_end_pos(9)
like, that's the whole relay friend group, and they all ate π₯
sign-off time π
this little icon came from ./kernel, dated October 2026, and she's filed under relay_switch_subbuf(9). mwah, go switch some sub-buffers bestie π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms