iob_new(3diet)

iob_new3diet

Create new i/o batch

Usage

#include <iob.h>

io_batch* iob_new(int hint_entries);

Overview

iob_new creates a new I/O batch with enough space allocated for hint_entries entries (buffers or files). This is purely a performance hint, if you are unsure just pass 1.

You can add buffers, strings and files to an I/O batch and then send it all at once using iob_send.

The benefit of the I/O batch API is that it exploits platform specific APIs like FreeBSD's sendfile. The file contents will always be sent in a way that allows the operating systems to perform zero copy TCP, and the buffers will always be sent using as few syscalls as possible and avoiding unnecessary copying (using writev).

Return value

iob_new returns a pointer to an I/O batch data structure. If there was a memory allocation error, it returns NULL instead.

Releases

Unchanged in 4 releases since Debian 3.1 (Sarge).

  1. 3.1–6.0

From libowfat-dev 0.28-2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.