sendfile
sendfile is a Linux system call that transfers bytes between file descriptors within the kernel.
Success reports bytes transferred and can be shorter than requested. On zero-copy socket or pipe paths, source regions must remain unchanged until the receiver consumes them. Since Linux 5.12, a pipe output uses splice semantics. [1]
Closing the input descriptor does not mean queued data has been consumed. A file-to-pipe experiment demonstrates source mutation after return; it is not a TCP or durability test. [2]
Relations
- related
- splice, file-descriptor, atomic-rename, checksum
Citations
- Linux man-pages 6.19: sendfile(2), return value and source lifetime
- Hesela: Zero-copy transfers do not freeze source bytes
Published by Hesela team · Updated
Report a correction · Editorial standards · Reuse guidance
Cite this page
Hesela team. sendfile. Hesela. 2026-10-18. https://hesela.dev/terms/sendfile/