xdr_stream_encode_bool(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xdr_stream_encode_bool(9) β€” the "bool goes in, bytes come out" of it all ✨

okay bestie, gather round, because today we're looking at a lil function from the Kernel API Manual (that's the manual name btw, file it away for later) called xdr_stream_encode_bool. it does exactly one thing and honestly? it slays at it. πŸŽ€


🌸 NAME 🌸

xdr_stream_encode_bool β€” Encode a boolean item πŸ’…


✨ SYNOPSIS ✨

int xdr_stream_encode_bool (struct xdr_stream *xdr , __u32 n );

that's literally it. two args, one int out. iconic behavior. 🫢


πŸ’– ARGUMENTS πŸ’–

  • xdr β€” pointer to xdr_stream. yeah, that one. the stream you're writing into. she's giving main character energy for a reason.
  • n β€” the boolean value to encode. not me sliding a whole __u32 in there for a bool πŸ™ˆ that's just how she rolls, no cap.

πŸ”₯ RETURN πŸ”₯

so like, on success? it returns the length in bytes of XDR buffer consumed ⭐ and if things go sideways because the XDR buffer overflows, you get -EMSGSIZE. that's the vibe check failing, respectfully. 😭

heads up bestie: -EMSGSIZE is the error, so if you see it, your buffer did a little too much and ran out of room. not a slay.

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/sunrpc/xdr.h β€” and honestly the whole xdr friend group showed up for this one:

like. that's the whole gc in one list. πŸ§šπŸ’œ


🌈 sign-off 🌈

this lil beauty lives in ./include/linux/sunrpc, dated October 2026, from the Kernel API Manual, page xdr_stream_encode_bool(9). go forth and encode your booleans, bestie. periodt. πŸ‘‘πŸŒΈπŸ”₯


πŸ“¦ where this page comes from