xdr_stream_...paque_inline(9)
π xdr_stream_encode_opaque_inline β the kernel API manual, bestie edition β¨
okay so this is a page from the Kernel API Manual (manual name: xdr_stream_...paque_inline(9), yes the title got truncated mid-word, she's doing her best π«Ά) and it's literally all about squishing opaque xdr data into a stream. it's giving "short page, important job" energy.
β¨ NAME β¨
xdr_stream_encode_opaque_inline β Encode opaque xdr data π
like, that's it, that's the whole vibe. she encodes. she's opaque. she's inline. iconic.
π SYNOPSIS π
ssize_t xdr_stream_encode_opaque_inline (struct xdr_stream *xdr , void
**ptr , size_t len );
no cap, that's the exact signature β three args, one ssize_t return, and she's wrapped across two lines in the original and we're keeping it that way because we respect the source material π
π¦ ARGUMENTS π¦
xdrβ pointer toxdr_stream. this is the stream, the main character, the thing everything happens inside of. πptrβ pointer to void pointer. yes bestie, a pointer to a pointer, double-indirection is a whole aesthetic and we're living for it. πlenβ size of object. how big the thing is. that's the whole note. β¨
πΈ RETURN πΈ
- On success β returns length in bytes of XDR buffer consumed. so she tells u exactly how much buffer she ate, which is honestly so considerate of her π
-EMSGSIZEβ on XDR buffer overflow. translation: the buffer ran out of room and she's not happy about it, so u get this negative errno instead. π
fr fr, check that return value. success gives u a byte count (a non-negative number), overflow gives u -EMSGSIZE. those are very different situations and u do not want to mix them up π
π₯ SEE ALSO π₯
Kernel file ./include/linux/sunrpc/xdr.h β that's the header where all the xdr lore lives, go read it, she's thick with content π
and then the whole friend group, in order, because every single one of these deserves a mention:
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_fixed(9)xdr_stream_encode_opaque(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)
note the last few β the decode_* girlies are the mirror-image counterparts of the encode_* ones, and notably xdr_stream_decode_opaque_inline(9) is literally this function's sibling. family reunion π§π
okay that's the page!! mwah π big kiss, go encode some opaque data responsibly.
sign-off moment: this gem comes from ./include/linux/sunrpc, dated October 2026, and it's filed under the xdr_stream_...paque_inline(9) entry in the Kernel API Manual. slay, documented, periodt. πβπ
π¦ 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