do_splice_direct(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

okay so this is do_splice_direct(9), straight out of the Kernel API Manual, and it is literally the page for do_splice_direct β€” the helper that splices data directly between two files. no cap, that's the whole name vibe: do_splice_direct - splices data directly between two files. πŸŽ€


✨ SYNOPSIS ✨

       ssize_t do_splice_direct (struct file *in , loff_t *ppos , struct file
       *out , loff_t *opos , size_t len , unsigned int flags );

πŸŽ€ ARGUMENTS πŸŽ€

  • in β€” the file you're splicing from bestie, aka the source file. πŸ’–
  • ppos β€” the input file offset. it's giving "where we're reading from" energy. ✨
  • out β€” the file you're splicing to, aka the destination file. πŸ¦‹
  • opos β€” the output file offset. literally where the write side is at. 🌸
  • len β€” the number of bytes to splice. yes, the byte count, the amount, the whole point. πŸ’…
  • flags β€” the splice modifier flags. little behavior modifiers, iconic. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so this helper is for use by do_sendfile, periodt. splice can easily emulate sendfile, but doing it in the application would incur an extra system call β€” literally splice in + splice out, as compared to just sendfile. so instead, this helper can splice directly through a process-private pipe. slay, no extra syscall drama. πŸ”₯

heads up bestie: callers already called rw_verify_area on the entire range. so that check is already handled, okay? πŸ‘‘

🌈 SEE ALSO 🌈

the kernel file is ./fs/splice.c, and it's giving a whole friend group of splice-related icons:


okay bye bestie πŸ’–βœ¨ this page is from ./fs, dated October 2026, and yes it's literally titled do_splice_direct(9) β€” go splice something cute πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from