readv: parallel or sequential?

Vlad GALU dudu at dudu.ro
Fri Dec 7 04:12:39 PST 2007


On 12/7/07, Ivan Voras <ivoras at freebsd.org> wrote:
> Hi,
>
> I found this in readv(2):
>
>      For readv() and preadv(), the iovec structure is defined as:
>
>            struct iovec {
>                    void   *iov_base;  /* Base address. */
>                    size_t iov_len;    /* Length. */
>            };
>
>      Each iovec entry specifies the base address and length of an area
> in mem-
>      ory where data should be placed.  The readv() system call will always
>      fill an area completely before proceeding to the next.
>
> Does this mean that, in effect, readv() is just a loop of read() calls
> (minus syscall overhead)?
>

   read() is just a particular case of readv() (with only one iovec
struct, plus the full buffer size), they both call kern_readv(), so
the effect is the same. I assume the manpage means that the iovec
structures are filled sequentially rather than in parallel.

>
>


-- 
Mahnahmahnah!


More information about the freebsd-fs mailing list