From owner-freebsd-standards@FreeBSD.ORG Tue Sep 9 17:34:37 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 C44F516A4BF; Tue, 9 Sep 2003 17:34:37 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id C86D143FBF; Tue, 9 Sep 2003 17:34:36 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost.nic.fr [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.9/8.12.9) with ESMTP id h8A0YTXV066681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.lcs.mit.edu issuer=SSL+20Client+20CA); Tue, 9 Sep 2003 20:34:30 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.9/8.12.9/Submit) id h8A0YTdY066678; Tue, 9 Sep 2003 20:34:29 -0400 (EDT) (envelope-from wollman) Date: Tue, 9 Sep 2003 20:34:29 -0400 (EDT) From: Garrett Wollman Message-Id: <200309100034.h8A0YTdY066678@khavrinen.lcs.mit.edu> To: deischen@freebsd.org In-Reply-To: References: <3F5B89B3.11367.112C1E2D@localhost> X-Spam-Score: -19.8 () IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) cc: Dan Nelson cc: Nate Lawson cc: Kern Sibbald cc: Dan Langille cc: freebsd-standards@freebsd.org 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 00:34:37 -0000 < 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