iov header

The documentation of QEMU’s qemu/iov.h header.

size_t iov_size(const struct iovec * iov, const unsigned int iov_cnt)

Parameters

const struct iovec * iov
undescribed
const unsigned int iov_cnt
undescribed

Description

starting at `iov’ of `iov_cnt’ number of elements.

size_t iov_from_buf_full(const struct iovec * iov, unsigned int iov_cnt, size_t offset, const void * buf, size_t bytes)

gather vector of buffers (iovec) and back like memcpy() between two continuous memory regions. Data in single continuous buffer starting at address `buf’ and `bytes’ bytes long will be copied to/from an iovec `iov’ with `iov_cnt’ number of elements, starting at byte position `offset’ within the iovec. If the iovec does not contain enough space, only part of data will be copied, up to the end of the iovec. Number of bytes actually copied will be returned, which is min(bytes, iov_size(iov)-offset) `Offset’ must point to the inside of iovec.

Parameters

const struct iovec * iov
undescribed
unsigned int iov_cnt
undescribed
size_t offset
undescribed
const void * buf
undescribed
size_t bytes
undescribed
size_t iov_memset(const struct iovec * iov, const unsigned int iov_cnt, size_t offset, int fillc, size_t bytes)

Parameters

const struct iovec * iov
undescribed
const unsigned int iov_cnt
undescribed
size_t offset
undescribed
int fillc
undescribed
size_t bytes
undescribed

Description

starting at byte offset `start’, to value `fillc’, repeating it `bytes’ number of times. `Offset’ must point to the inside of iovec. If `bytes’ is large enough, only last bytes portion of iovec, up to the end of it, will be filled with the specified value. Function return actual number of bytes processed, which is min(size, iov_size(iov) - offset).

void iov_hexdump(const struct iovec * iov, const unsigned int iov_cnt, FILE * fp, const char * prefix, size_t limit)

Parameters

const struct iovec * iov
undescribed
const unsigned int iov_cnt
undescribed
FILE * fp
undescribed
const char * prefix
undescribed
size_t limit
undescribed

Description

in file `fp’, prefixing each line with `prefix’ and processing not more than `limit’ data bytes.