Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Sep 2003 20:46:02 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: comments on proposed uthread_write.c changes
Message-ID:  <Pine.GSO.4.10.10309092044340.28357-100000@pcnet5.pcnet.com>
In-Reply-To: <200309100034.h8A0YTdY066678@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 9 Sep 2003, Garrett Wollman wrote:

> <<On Tue, 9 Sep 2003 19:46:12 -0400 (EDT), Daniel Eischen <eischen@vigrid.com> said:
> 
> >   Libc_r's write treats a return of 0 from __sys_write() as a
> >   partial write and continues looping.
> 
> This is a bug.  The Standard is quite clear that a write of zero bytes
> is not possible unless the supplied buffer length is zero.  In the
> specific case of non-blocking files, if data might be written but
> doing so would cause the calling thread to block, write() must return
> -1 with errno set to [EAGAIN]; it may not return zero.  Therefore, a
> zero return from write() always indicates a permanent condition.

Thanks.

Dan (Langille), go ahead and commit the fix to -current if
you'd like.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10309092044340.28357-100000>