io_sendfile(3)

io_sendfile3

Send data from a file to a socket

Usage

#include <libowfat/io.h>

int64 io_sendfile(int64 sock,int64 fd,uint64 off,uint64 n);

Overview

io_sendfile sends data from a file to a socket. This function tries to do this in a way that allows high quality operating systems to do zero-copy TCP (serving the data without copying the file contents to user space or inside kernel space). This function will use special operating system "sendfile" primitives where available and use memory mapped I/O otherwise. It should always be faster than using read() and write() to copy the data yourself.

io_sendfile will return the number of bytes sent. If an error occurred, it will return -1 for EAGAIN, or -3 otherwise.

Releases

7 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–11
  2. 12–13

From libowfat-dev 0.32-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.