iolist scatter / gather IO

Provides linked-list scatter / gather IO. More...

Detailed Description

Provides linked-list scatter / gather IO.

Files

file  iolist.h
 iolist scatter / gather IO
 

Data Structures

struct  iolist
 iolist structure definition More...
 

Typedefs

typedef struct iolist iolist_t
 iolist forward declaration
 

Functions

unsigned iolist_count (const iolist_t *iolist)
 Count number of entries in an iolist_t. More...
 
size_t iolist_size (const iolist_t *iolist)
 Sum up number of bytes in iolist. More...
 
size_t iolist_to_iovec (const iolist_t *iolist, struct iovec *iov, unsigned *count)
 Create struct iovec from iolist. More...
 

Function Documentation

◆ iolist_count()

unsigned iolist_count ( const iolist_t iolist)

Count number of entries in an iolist_t.

Parameters
[in]iolistiolist to count
Returns
number of entries (zero for NULL parameter)

◆ iolist_size()

size_t iolist_size ( const iolist_t iolist)

Sum up number of bytes in iolist.

This function returns the summed ip length values of all entries in iolist.

Parameters
[in]iolistiolist to sum up
Returns
summed up number of bytes or zero if iolist == NULL

◆ iolist_to_iovec()

size_t iolist_to_iovec ( const iolist_t iolist,
struct iovec iov,
unsigned *  count 
)

Create struct iovec from iolist.

This function fills an array of struct iovecs with the contents of iolist. It will write the number of used array entries into count.

The caller must ensure that iov p points to an array of size >= count!

Parameters
[in]iolistiolist to read from
[out]iovptr to array of struct iovec that will be filled
[out]countnumber of elements in iolist
Returns
iolist_size(iolist)