sendfile(2) System Calls Manual sendfile(2) sendfile - (libc -lc) #include ssize_t sendfile(int out_fd, int in_fd, off_t *_Nullable offset, size_t count); sendfile() . sendfile() read(2) write(2) . in_fd out_fd . offset NULL sendfile() in_fd. sendfile() . offset NULL sendfile() in_fd in_fd. offset NULL in_fd . count . in_fd mmap(2) ( ). Linux 5.12 out_fd sendfile() splice(2) . Linux 2.6.33 out_fd . Linux 2.6.33 . sendfile() . out_fd. sendfile() . . -1 errno . EAGAIN / O_NONBLOCK . EBADF . EFAULT . EINVAL mmap(2) in_fd count . EINVAL out_fd O_APPEND . sendfile(). EIO in_fd. ENOMEM in_fd. EOVERFLOW count . ESPIPE offset NULL . UNIX sendfile() . . . Linux 2.2, glibc 2.1. Linux 2.4 out_fd Linux 2.6.x Linux 2.6.33. Linux sendfile() . Linux 2.4 sendfile64() offset. glibc sendfile() . sendfile() 0x7ffff000 (2,147,479,552) . ( 32 64 .) sendfile() TCP TCP_CORK tcp(7) . read(2) write(2) sendfile() EINVAL ENOSYS. out_fd in_fd out_fd . splice(2) Linux ( ) . copy_file_range(2) mmap(2) open(2) socket(2) splice(2) 3 . . : . 6.18 8 2026 sendfile(2)