xdr_terminate_string(9)
β¨ xdr_terminate_string β the '\0' glow-up for your XDR string π
Okay bestie, listen up, because this one is a tiny little function with main character energy. We're in the kernel API manual for xdr_terminate_string, and it does exactly one iconic thing:
' '-terminate a string residing in an xdr_buf
That's it. That's the whole vibe. It goes in, it drops a terminator at the end of your string, and it leaves. No drama, no cap. π
πΈ SYNOPSIS
void xdr_terminate_string (const struct xdr_buf *buf , const u32 len );
Literally just two arguments and a whole lot of slay. β¨
π¦ ARGUMENTS
bufβ the XDR buffer where your string is living its best life. It'sconst struct xdr_buf *, so likeβ¦ we're looking, not touching. Respect the boundaries, bestie. πlenβ the length of the string, in bytes. It's au32, so keep it tidy. π
π SEE ALSO
Ok so this function does not roll alone β it's part of a whole friend group, and here's the entire group chat, fr fr. The kernel file is ./net/sunrpc/xdr.c, and the squad is:
xdr_encode_opaque_fixed(9)xdr_encode_opaque(9)xdr_buf_to_bvec(9)xdr_buf_to_sg(9)xdr_buf_to_sg_alloc(9)xdr_inline_pages(9)_shift_data_left_pages(9)_shift_data_right_pages(9)_copy_to_pages(9)_copy_from_pages(9)xdr_buf_pages_zero(9)xdr_shrink_bufhead(9)xdr_shrink_pagelen(9)xdr_stream_pos(9)xdr_page_pos(9)xdr_init_encode(9)xdr_init_encode_pages(9)__xdr_commit_encode(9)xdr_reserve_space(9)xdr_reserve_space_vec(9)xdr_truncate_encode(9)xdr_truncate_decode(9)xdr_restrict_buflen(9)xdr_write_pages(9)xdr_init_decode(9)xdr_init_decode_pages(9)xdr_finish_decode(9)xdr_inline_decode(9)xdr_read_pages(9)xdr_set_pagelen(9)xdr_enter_page(9)xdr_buf_subsegment(9)xdr_stream_subsegment(9)xdr_stream_move_subsegment(9)xdr_stream_zero(9)xdr_buf_trim(9)xdr_stream_decode_string_dup(9)xdr_stream_decode_opaque_auth(9)xdr_stream_encode_opaque_auth(9)
Like, that's a whole roster. Collect them all, iykyk. ππ
π a lil sign-off π
This absolute gem lives in ./net/sunrpc, and the page itself is dated October 2026 β so yes, it's from the future, and yes, it's still serving. π«Ά Go forth and terminate those strings, 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