lkml.org 
[lkml]   [1999]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.038 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site