xdr_stream_encode_bool(9)
β¨ 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 toxdr_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__u32in 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:
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_u32(9)xdr_stream_encode_be32(9)xdr_stream_encode_u64(9)xdr_stream_encode_opaque_inline(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)
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
- 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