why limit of 16 iovec's in readv/writev?

Lars Henrik Mathiesen thorinn at skinfaxe.diku.dk
Mon Nov 27 01:56:45 AEST 1989


buck at siswat.UUCP (A. Lester Buck) writes:
>In article <4996 at freja.diku.dk>, thorinn at skinfaxe.diku.dk (Lars Henrik Mathiesen) writes:
>> In my opinion you should not use the readv/writev mechanism to provide
>> packet delimiters.

>Reasons, please?  Works just fine for me.
>Why not use readv/writev if they are there?

Normally, the 4.3 BSD kernel does its best to treat all the iovecs in
a single call to readv/writev as one continuous buffer --- that
includes the PF_REMOTE mode of pseudo-ttys, for instance. That's why I
thought that it would be confusing to use other semantics, and that it
should therefore be avoided.

But it turns out that I had overlooked the "physical I/O" character
devices, such as raw tapes (and disks, and so on). These devices call
the physio routine, which in turn calls the driver's strategy routine
once (at least) _per_iovec_. On tapes this gives one tape block per
iovec (I think). So, after all, your usage is actually quite
consistent with the system. Sorry for the confusion.

--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcvax!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.      thorinn at diku.dk



More information about the Comp.unix.wizards mailing list