xdr_stream_encode_opaque(9)
β¨ xdr_stream_encode_opaque(9) β¨
okay so bestie, welcome to the xdr_stream_encode_opaque(9) page β this is a Kernel API Manual moment and honestly it's giving "small function, big job" π
it lives in ./include/linux/sunrpc and it's about encoding variable length opaque xdr data. that's the whole vibe. let's get into it π«Ά
π NAME π
xdr_stream_encode_opaque β Encode variable length opaque xdr data
like, it takes your opaque data and squishes it into the xdr stream. variable length. no cap. β¨
πΈ SYNOPSIS πΈ
ssize_t xdr_stream_encode_opaque (struct xdr_stream *xdr , const void
*ptr , size_t len );
the way this signature just sits there being all ssize_t... iconic honestly π₯
π¦ ARGUMENTS π¦
xdrβ pointer to xdr_stream. it's the stream, it's the main character, it's where everything goes πptrβ pointer to opaque data object. this is your actual data, the star of the show πlenβ size of object pointed to byptr. gotta tell it how big your little guy is, fr fr π
π RETURN π
On success, returns the length in bytes of XDR buffer consumed π₯
on XDR buffer overflow it returns -EMSGSIZE π (that's the "bestie your buffer is full" error, no cap)
heads up π β successful return is the bytes consumed, not some generic 0. -EMSGSIZE is specifically the XDR buffer overflow case, so don't mix those two up, iykyk π
π SEE ALSO π
these are all the friends in the group chat, and yes you have to acknowledge every single one of them π
Kernel file ./include/linux/sunrpc/xdr.h
xdr_set_scratch_buffer(9)xdr_set_scratch_folio(9)xdr_reset_scratch_buffer(9)xdr_commit_encode(9)xdr_stream_remaining(9)xdr_align_size(9)xdr_pad_size(9)xdr_stream_encode_item_present(9)xdr_stream_encode_item_absent(9)xdr_encode_bool(9)xdr_stream_encode_bool(9)xdr_stream_encode_u32(9)xdr_stream_encode_be32(9)xdr_stream_encode_u64(9)xdr_stream_encode_opaque_inline(9)xdr_stream_encode_opaque_fixed(9)xdr_stream_encode_uint32_array(9)xdr_item_is_absent(9)xdr_item_is_present(9)xdr_stream_decode_bool(9)xdr_stream_decode_u32(9)xdr_stream_decode_be32(9)xdr_stream_decode_u64(9)xdr_stream_decode_opaque_fixed(9)xdr_stream_decode_opaque_inline(9)xdr_stream_decode_uint32_array(9)
like... that's the whole encode squad and the decode squad, and they all ate tbh π
and that's the page, bestie π§ this lil slice of the Kernel API Manual came from ./include/linux/sunrpc and it's dated October 2026 β so jot that down, screenshot it, whatever you gotta do πβ¨ππ
π¦ 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