relay_close_buf(9)
π relay_close_buf(9) β from the Kernel API Manual, bestie
okay so picture this: you've got a channel buffer and you're done with it. this little function right here is the final goodbye wave. π it's giving "closing time at the group chat" energy, and honestly? iconic.
β¨ NAME β¨
relay_close_buf β close a channel buffer π
like, literally, that's the whole job. close the buffer. slay.
πΈ SYNOPSIS πΈ
void relay_close_buf (struct rchan_buf *buf );
no return value, no drama, just vibes. π
π¦ ARGUMENTS π¦
bufβ channel buffer. that's it. that's the whole argument. the main character of this call. π
π₯ DESCRIPTION π₯
so what actually happens, no cap? relay_close_buf marks the buffer finalized β like stamping "done β
" on it β and it restores the default callbacks. put those two things back the way they were, periodt.
and then? the freeing is lowkey automatic, bestie. both the channel buffer and the channel buffer data structure get freed automatically when the last reference is given up. not me setting up a whole reference-counting moment and letting it cook. π
β οΈ heads up: it's the last reference giving up that triggers the free, so don't be out here assuming it's gone instantly. the vibe check happens when the refcount hits zero, ok? π
π§ SEE ALSO π§
kernel file ./kernel/relay.c, plus the whole friend group:
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_open(9)relay_switch_subbuf(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)
and that's the whole page, bestie π«Ά this one came straight out of ./kernel, dropped in October 2026 β go forth and close those buffers responsibly πβ¨π
π¦ 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