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 More...
 

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...
 
ssize_t iolist_to_buffer (const iolist_t *iolist, void *dst, size_t len)
 Copies the bytes of the iolist to a buffer. More...
 

Typedef Documentation

◆ iolist_t

typedef struct iolist iolist_t

iolist forward declaration

Definition at line 34 of file iolist.h.

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_buffer()

ssize_t iolist_to_buffer ( const iolist_t iolist,
void *  dst,
size_t  len 
)

Copies the bytes of the iolist to a buffer.

Parameters
[in]iolistiolist to read from
[out]dstDestination buffer
[in]lenSize of the destination buffer
Returns
iolist_size(iolist) on success -ENOBUFS if the buffer is too small

◆ 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)