From owner-freebsd-standards@FreeBSD.ORG Wed Sep 10 00:19:57 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 CDF5C16A4BF; Wed, 10 Sep 2003 00:19:57 -0700 (PDT) Received: from matou.sibbald.com (matou.sibbald.com [195.202.201.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7797043FBF; Wed, 10 Sep 2003 00:19:55 -0700 (PDT) (envelope-from kern@sibbald.com) Received: from [192.168.68.112] (rufus [192.168.68.112]) by matou.sibbald.com (8.11.6/8.11.6) with ESMTP id h8A7JhE30153; Wed, 10 Sep 2003 09:19:43 +0200 From: Kern Sibbald To: Garrett Wollman In-Reply-To: <200309100034.h8A0YTdY066678@khavrinen.lcs.mit.edu> References: <3F5B89B3.11367.112C1E2D@localhost> <200309100034.h8A0YTdY066678@khavrinen.lcs.mit.edu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-dQwOkbSDWJuqMz0oqlSu" Organization: Message-Id: <1063178382.15482.550.camel@rufus> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 10 Sep 2003 09:19:43 +0200 cc: deischen@freebsd.org cc: freebsd-standards@freebsd.org cc: Dan Nelson cc: Dan Langille cc: Nate Lawson Subject: Re: comments on proposed uthread_write.c changes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2003 07:19:57 -0000 --=-dQwOkbSDWJuqMz0oqlSu Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, On Wed, 2003-09-10 at 02:34, Garrett Wollman wrote: > < said: >=20 > > Libc_r's write treats a return of 0 from __sys_write() as a > > partial write and continues looping. >=20 > 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. >=20 > -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. In reading the standard, the paragraph cited below permits a zero to be returned.=20 If a write() requests that more bytes be written than there is room for (for example, [XSI] [Option Start] the process' file size limit =20 or [Option End] the physical end of a medium), only as many bytes as there is room for shall be written. Best regards, --=-dQwOkbSDWJuqMz0oqlSu Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA/XtCONgfoSvWqwEgRApwFAJ94WujQGeGZzrHVrW/qCZt7P8wIUwCgtzsF SNJ4mzYtOq/Jzhvrq+JK7F8= =Y3zY -----END PGP SIGNATURE----- --=-dQwOkbSDWJuqMz0oqlSu--