xdr_reserve_space_vec(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xdr_reserve_space_vec(9) β€” from the Kernel API Manual

okay so bestie, buckle up, we're doing kernel XDR today ✨ this one lives in the 9 section of the kernel API manual and it's genuinely so straightforward you'll be obsessed 🫢


✨ NAME ✨

xdr_reserve_space_vec β€” reserves a large amount of buffer space for sending πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

int xdr_reserve_space_vec (struct xdr_stream *xdr , size_t nbytes );

🌸 ARGUMENTS 🌸

  • xdr β€” pointer to xdr_stream (the stream bestie in question πŸ’…)
  • nbytes β€” number of bytes to reserve

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe 🌈 the size argument that gets passed to xdr_reserve_space is determined based on the number of bytes remaining in the current page β€” and the whole reason for that is to avoid invalidating iov_base pointers when xdr_commit_encode is called. no cap, that's the entire point of this little guy πŸ’€

Return values, fr fr:

  • 0 β€” success, slay πŸ‘‘
  • -EMSGSIZE β€” not enough space is available in xdr 😭

⭐ SEE ALSO ⭐

Kernel file ./net/sunrpc/xdr.c β€” plus the whole ensemble cast, and yes I'm listing every single one because they all ate πŸ”₯


πŸ’œ reminder bestie: -EMSGSIZE isn't a moral failure, it just means the xdr buffer literally had no room. check your space before you go reserving, iykyk πŸ™ˆ

anyway, that's the whole page 🧚 this cutie is from ./net/sunrpc, dated October 2026 β€” go forth and reserve responsibly, periodt πŸ’…πŸ“

πŸ“¦ where this page comes from