xdr_pad_size(9)
π« xdr_pad_size(9) π«
okay so this is a page from the Kernel API Manual β yes bestie, the kernel has manpages and they're lowkey iconic π
β¨ NAME β¨
xdr_pad_size β the little function that calculates the size of an object's pad. that's it. that's the whole job. and it eats π
πΈ SYNOPSIS πΈ
size_t xdr_pad_size (size_t n );
π¦ ARGUMENTS π¦
nβ the size of the object being XDR encoded, and yes it's in bytes (had to say it, the units girlies know π)
π DESCRIPTION π
so the way this implementation works? it avoids the need for conditional branches or modulo division. no if, no %, none of that. it's giving efficiency, it's giving main character energy, it's giving "i don't do branches" β
π RETURN π
returns the size (in bytes) of the needed XDR pad. that's the number you came for π
π₯ SEE ALSO π₯
the kernel file ./include/linux/sunrpc/xdr.h and honestly the whole xdr friend group:
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_stream_encode_item_present(9)xdr_stream_encode_item_absent(9)xdr_encode_bool(9)xdr_stream_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... the whole roster. go read them, i'll wait π«Ά
and that's the page!! from ./include/linux/sunrpc, dated October 2026 β mwah, slay, no cap, see u in the next manpage bestie ππ
π¦ 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