limb 0.2.0

2024-01-09

siov_trunc(3)
limb manual
siov_trunc(3)

NAME

siov_trunc - truncate an array of vectors

SYNOPSIS

#include <limb/siovec.h>
unsigned int siov_trunc(struct iovec *v, unsigned int n, size_t len)

DESCRIPTION

The siov_trunc() function updates the array v of n vectors so that it only contains len bytes of data.

If len is larger than the amount of data within the array, nothing happens. Otherwise, as many vectors (from the end of the array) as needed will be updated. Only the array is modified, the data itself remains untouched.

RETURN VALUE

The siov_trunc() function return the new number of vectors needed in the array. That is, ignoring any vector at the end of the array that doesn't represent any data (having been zeroed out, or already being empty in the first place) and can therefore be ignored.

SEE ALSO

siov_len(3), siov_seek(3)

limb 0.1.0
2023-07-24
siov_trunc(3)