Nope didn't screw up, from strace of that test program:
writev(3, [{"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"..., 100}, {"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"..., 100}], 2) = 200
Setting TCP_NODELAY didn't help -- still split into two packets.
Dean
On Sun, 26 Jan 1997, Alan Cox wrote:
> Linux will normally coallesce writev() in accordance with the protocol. It
> always does this for UDP, and RAW sockets. For TCP you will see the same
> but the data may be split according to Nagle and maximum fragment sizes
>
> Old libc's emulate writev() rather than using the later kernel writev()
> and this causes the behaviour you describe. Try again with 2.0.x and
> libc5.3.12
>
>