Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / siovec.h / siov_scatter.3.md

% limb manual
% siov_scatter(3)
% limb 0.1.0
% 2023-07-24

# NAME

siov_scatter - scatter data from a byte array into an array of vectors

# SYNOPSIS

    #include <limb/siovec.h>

```pre hl
size_t siov_scatter(const struct iovec *<em>v</em>, unsigned int <em>n</em>, const char *<em>data</em>, size_t <em>dlen</em>)
```

# DESCRIPTION

The `siov_scatter`() function scatters data pointed by `data` of length `dlen`
into the array `v` of `n` vectors.

You can think of it as the opposite of [siov_gather](3).

It is similar to [siov_deal](3) only copying data from a byte array instead of
another array of vectors. As such, the note on [siov_deal](3) applies here as
well.

# RETURN VALUE

The `siov_scatter`() function returns the amount of data copied, which may be
less than `dlen`, if there wasn't enough space in the memory represented by the
`v` array of `n` vectors, or less than what `siov_len(v, n)` would return, as
explained in [siov_deal](3).

# SEE ALSO

[siov_deal](3), [siov_gather](3)