Saturday, February 18, 2012

struct iovec iov

I/O Vector is defined by including the file:

#include <sys/uio.h>

The functions readv and writev both use a concept of an I/O vector. The sys/uio.h include file defines the struct iovec, which is defined as follows:

struct iovec {
   ptr_t iov_base; /* Starting address */
   size_t iov_len; /* Length in bytes */
};

The struct iovec defines one vector element. Normally, this structure is used as an array of multiple elements. For each transfer element, the pointer member iov_base points to a buffer that is receiving data for readv or is transmitting data for writev. The member iov_len in each case determines the maximum receive length and the actual write length, respectively.

See Also:

No comments:

Post a Comment