KCAPI_SET_MAXSPLICES(3)

πŸ’– KCAPI_SET_MAXSPLICESIZE πŸ’–

okay bestie, welcome to the <pink>kcapi_set_maxsplicesize</pink> page β€” she's a little function that sets the maximum buffer size for splice. no cap. 🌸


✨ SYNOPSIS ✨

int kcapi_set_maxsplicesize(struct kcapi_handle * handle,
                            unsigned int size);

πŸŽ€ ARGUMENTS πŸŽ€

  • handle β€” [in] the cipher handle, and you the caller are the one who allocated it, so it's your baby 🫢
  • size β€” [in] the new maximum buffer size, in bytes. yes bytes, the classic unit πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: when you use vmsplice/splice to dodge copying data into the kernel (iconic behaviour, honestly), the kernel is like "mmm no, there's a maximum number of bytes you can splice, periodt." so if bigger data shows up wanting to be processed, sendmsg gets called instead. not the main character moment you planned, but okay. 😭

and that's literally where this call comes in β€” using this call, the buffer size can be increased. slay. ✨


⚠️ NOTE ⚠️

splice uses a pipe pair, bestie. so the maximum number of bytes that can be stored with the pipe is what governs the maximum data size to be spliced. the way that pipe buffer size works… πŸ‘‘

increasing the pipe buffer size is only allowed up to the maximum specified with /proc/sys/fs/pipe-max-size. so don't go feral, there's a ceiling and the ceiling said no. πŸ™ˆ

and for the return: return 0 upon success; a negative errno-style error code if an error occurred. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de>

  • Author.

libkcapi Manual 1.5.0 β€” July 2025.


and that's the whole page, bestie β€” kcapi_set_maxsplicesize, documented, understood, ate. go forth and splice responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from