{
  "slug": "sendfile",
  "term": "sendfile",
  "aliases": [],
  "definition": "sendfile is a Linux system call that transfers bytes between file descriptors within the kernel.",
  "note": "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. [sendfile]\n\nClosing 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. [hesela-lifetime]",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "related": [
    "splice",
    "file-descriptor",
    "atomic-rename",
    "checksum"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "sendfile",
      "title": "Linux man-pages 6.19: sendfile(2), return value and source lifetime",
      "url": "https://man7.org/linux/man-pages/man2/sendfile.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-lifetime",
      "title": "Hesela: Zero-copy transfers do not freeze source bytes",
      "url": "https://hesela.com/analyses/zero-copy-source-lifetime/",
      "accessed": "2026-10-18"
    }
  ],
  "updated": "2026-10-18"
}
