xdr_stream_encode_opaque(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 by ptr. 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

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