xdr_stream_subsegment(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xdr_stream_subsegment(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” this is the page for xdr_stream_subsegment(9), and it is lowkey iconic for doing exactly one little slice-of-XDR job. πŸŽ€


✨ NAME ✨

xdr_stream_subsegment β€” set @subbuf to a portion of @xdr. That's the whole name, and it ate. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

bool xdr_stream_subsegment (struct xdr_stream *xdr , struct xdr_buf
*subbuf , unsigned int nbytes );

πŸŽ€ ARGUMENTS πŸŽ€

  • xdr β€” an xdr_stream set up for decoding. Like your notes app, but for XDR data, and it's ready to scroll. ✨
  • subbuf β€” the result buffer. This is where the little portion lands. 🫢
  • nbytes β€” length of xdr to extract, in bytes. Actual bytes, not vibes. πŸ’–

🌸 DESCRIPTION 🌸

Sets up subbuf to represent a portion of xdr. The portion starts at the current offset in xdr, and extends for a length of nbytes. If this is successful, xdr is advanced to the next XDR data item following that portion.

Return values: true: subbuf has been initialized, and xdr has been advanced. false: a bounds error has occurred.

bestie, the false case is a bounds error β€” that's the vibe check failing, so don't ignore it. 😭

🌈 SEE ALSO 🌈

The kernel file ./net/sunrpc/xdr.c is on the list, and honestly the whole XDR friend group pulled up too:


Signed, sealed, and delivered with main-character energy by ./net/sunrpc, dated October 2026. Periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from