From owner-freebsd-standards@FreeBSD.ORG Wed Sep 10 06:34:23 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA33316A4BF for ; Wed, 10 Sep 2003 06:34:23 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E83F443F3F for ; Wed, 10 Sep 2003 06:34:22 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h8ADYHtp006688; Wed, 10 Sep 2003 09:34:17 -0400 (EDT) Date: Wed, 10 Sep 2003 09:34:17 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Kern Sibbald In-Reply-To: <1063178382.15482.550.camel@rufus> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: Nate Lawson cc: Dan Nelson cc: Dan Langille Subject: Re: comments on proposed uthread_write.c changes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2003 13:34:23 -0000 On 10 Sep 2003, Kern Sibbald wrote: > Hello, > > On Wed, 2003-09-10 at 02:34, Garrett Wollman wrote: > > < 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. > > > > -GAWollman > > Can you explain how you came to the conclusion that a non-zero > write may not return zero? Keep in mind that from the > user's or my standpoint, we are talking about blocking > writes. He saying that it is an exception and should be returned as such to the caller. -- Dan Eischen