readv(2) and writev(2)

Conrad Scott
Wed Jul 31 11:31:00 GMT 2002

I'd really like to get access to the scatter/gather IO available
in winsock but currently cygwin implements the readv(2) and
writev(2) system calls by a sequence of reads and writes.  Leaving
aside efficiency questions, this also breaks the semantics of
writev(2) on packet devices since it is meant to do an atomic
write.  (Nb. the WSASend function does have the appropriate
semantics on "message-oriented sockets".)

Of existing packages on cygwin, at least Apache and several of its
modules use writev(2), tho' (AFAICT from a brief glimpse) it's
only over stream sockets, so the semantics problem isn't an issue;
the efficiency one might well be.  My interest (as usual) is
cygserver where writev(2) should make a performance difference.

So, would anyone object if I did the work to change cygwin around
to make use of the underlying scatter/gather operations?

I was thinking of first re-arranging the fhandler interfaces so
that the scatter/gather calls are the primitives and the other
routines end up calling these (as a comment in ""
suggests).  A second step would be to move the socket code over to
use a scatter/gather implementation via WSASend and WSARecv.

For the moment,

// Conrad

More information about the Cygwin-developers mailing list