Messages in this thread | | | Date | Thu, 3 Jun 1999 01:30:27 -0700 | From | "David S. Miller" <> | Subject | Re: writev() BUGS! |
| |
Date: 03 Jun 1999 10:13:03 +0200 From: Jonathan NAYLOR <Jonathan.Naylor@socgen.com>
That is probably because *usually* all of the data is accepted by one write[v]. But the specification is quite specific in stating that a short write is not an error.
True.
> I would believe a lot software would break if write returned partial > results on blocking software.
That is bad programming then. If you look in a text such as "UNIX Network Programming" by Richard Stevens, or the manual page for write under Solaris, or even (gasp) the documentation for send() on Windows NT, they all speak of partial writes on a socket.
The "standard" way to handle a write on a socket correctly is:
Correct, in fact have a look at
xc/programs/Xserver/os/io.c:FlushClient()
from the X sources.
It has this exact structure and manages partial writev() calls just fine.
Really, it's pretty clear that a partial writev is valid and properly written applications have no problems at all with it.
Later, David S. Miller davem@redhat.com
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |