xdr_buf_trim(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

okay so bestie, youโ€™re looking at xdr_buf_trim(9) from the Kernel API Manual ๐Ÿซถ This is the little XDR helper that lops bytes off the end of a buffer, and yes itโ€™s giving โ€œshort kingโ€ energy but make it kernel API ๐Ÿ’…โœจ

๐Ÿ’– NAME ๐Ÿ’–

xdr_buf_trim โ€” โ€œlop at most "len" bytes off the end of "buf"โ€. Thatโ€™s the entire name-card, no cap. ๐ŸŽ€

โœจ SYNOPSIS โœจ

Hereโ€™s the exact signature, character for character, because we respect the code:

void xdr_buf_trim (struct xdr_buf *buf , unsigned int len );

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • buf โ€” the struct xdr_buf * that is literally โ€œbuf to be trimmedโ€. We trim this one, bestie. ๐Ÿ’–
  • len โ€” the number of bytes to reduce "buf" by. Thatโ€™s the amount weโ€™re trying to lop off. ๐ŸŒธ

๐ŸŒธ DESCRIPTION ๐ŸŒธ

Trim an xdr_buf by the given number of bytes by fixing up the lengths. Thatโ€™s the move. Lengths get fixed up, and thatโ€™s the trim.

Note that itโ€™s possible that weโ€™ll trim less than that amount if the xdr_buf is too small, or if (for instance) itโ€™s all in the head and the parser has already read too far into it. So if the trim comes up short, donโ€™t come for the function โ€” thatโ€™s the documented situation, iykyk ๐Ÿ˜ญ๐Ÿ’€

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

Kernel file ./net/sunrpc/xdr.c is on the guest list, plus these manual-page besties:


source/version: ./net/sunrpc ยท date: October 2026 ยท page: xdr_buf_trim(9) โ€” mwah, go trim those buffers and have the best day, bestie ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from