xdr_stream_encode_u32(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« xdr_stream_encode_u32 β€” it's in the Kernel API Manual, bestie πŸ’«

okay so picture this: you're deep in kernel land, ./include/linux/sunrpc/xdr.h is literally right there, and you just need to squash a number into an XDR buffer. That's the whole gig. This little icon does exactly one thing and does it slay. ✨


πŸŽ€ NAME πŸŽ€

xdr_stream_encode_u32 β€” Encode a 32-bit integer</p> πŸ“

Like, that's it. That's the function. One job, zero drama.


✨ SYNOPSIS ✨

ssize_t xdr_stream_encode_u32 (struct xdr_stream *xdr , __u32 n );

Look at her. ssize_t coming back at you, pointer in, integer in. Clean. πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • xdr β€” pointer to xdr_stream. Yeah, the stream. The whole vibe. It's where the encoding happens, so hand her over gently. 🫢
  • n β€” integer to encode. That's the __u32 bestie, the actual number going in. 🌸

πŸ”₯ RETURN πŸ”₯

On success, returns length in bytes of XDR buffer consumed β€” and if the XDR buffer overflows? -EMSGSIZE. πŸ’€ No cap, that's the error, so check your return value, bestie, don't just assume it worked.

lowkey important: successful return = bytes consumed. Failure = -EMSGSIZE. Those are two very different energies. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/sunrpc/xdr.h β€” and honestly the whole friend group:

whole encode gang, whole decode gang, all accounted for. iykyk πŸ’œ


mwah, that's the page 🧚 source lives over in ./include/linux/sunrpc, dated October 2026, and this whole manual moment is filed under xdr_stream_encode_u32(9). go encode something iconic, bestie πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from