xdr_buf_subsegment(9)
π« xdr_buf_subsegment(9) β from the Kernel API Manual, bestie π«
okay so real talk, this is a kernel API page, and yes the manual calls itself xdr_buf_subsegment(9). we're doing this together. hold my iced coffee π«Ά
β¨ NAME β¨
xdr_buf_subsegment β set subbuf to a portion of buf π―
πΈ SYNOPSIS πΈ
int xdr_buf_subsegment (const struct xdr_buf *buf , struct xdr_buf
*subbuf , unsigned int base , unsigned int len );
literally the whole signature, no notes π
π ARGUMENTS π
bufβ an xdr buffer (the source one, the main character)subbufβ the result buffer, where the answer goes πbaseβ beginning of range in byteslenβ length of range in bytes
π¦ DESCRIPTION π¦
so what it does: it sets subbuf to an xdr buffer representing the portion of buf of length len starting at offset base. like slicing a piece of cake and putting it on a whole other plate π°
bestie-coded detail:bufandsubbufmay be pointers to the samestruct xdr_buf. yes, same pointer, no cap. iconic self-referential behavior πͺ
Returns -1 if base or length are out of bounds. that's the failure path, be aware π
π SEE ALSO π
Kernel file ./net/sunrpc/xdr.c β go read it, the whole friend group lives there π
xdr_encode_opaque_fixed(9), xdr_encode_opaque(9), xdr_terminate_string(9), xdr_buf_to_bvec(9), xdr_buf_to_sg(9), xdr_buf_to_sg_alloc(9), xdr_inline_pages(9), _shift_data_left_pages(9), _shift_data_right_pages(9), _copy_to_pages(9), _copy_from_pages(9), xdr_buf_pages_zero(9), xdr_shrink_bufhead(9), xdr_shrink_pagelen(9), xdr_stream_pos(9), xdr_page_pos(9), xdr_init_encode(9), xdr_init_encode_pages(9), __xdr_commit_encode(9), xdr_reserve_space(9), xdr_reserve_space_vec(9), xdr_truncate_encode(9), xdr_truncate_decode(9), xdr_restrict_buflen(9), xdr_write_pages(9), xdr_init_decode(9), xdr_init_decode_pages(9), xdr_finish_decode(9), xdr_inline_decode(9), xdr_read_pages(9), xdr_set_pagelen(9), xdr_enter_page(9), xdr_stream_subsegment(9), xdr_stream_move_subsegment(9), xdr_stream_zero(9), xdr_buf_trim(9), xdr_stream_decode_string_dup(9), xdr_stream_decode_opaque_auth(9), xdr_stream_encode_opaque_auth(9)
that's the whole page, every single one of them, i counted twice π
sign-off time: this one comes from ./net/sunrpc, dated October 2026, and the page itself is xdr_buf_subsegment(9). slay, go read your kernel source, mwah π§π
π¦ 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