From owner-cvs-src@FreeBSD.ORG Wed Dec 17 21:53:51 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9590816A4CE; Wed, 17 Dec 2003 21:53:51 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DB8343D45; Wed, 17 Dec 2003 21:53:48 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id QAA02041; Thu, 18 Dec 2003 16:53:39 +1100 Date: Thu, 18 Dec 2003 16:53:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nate Lawson In-Reply-To: <20031217122003.B70894@root.org> Message-ID: <20031218164341.J19119@gamplex.bde.org> References: <20031217122003.B70894@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Daniel Eischen Subject: Re: cvs commit: src/lib/libc_r/uthread uthread_write.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Dec 2003 05:53:51 -0000 On Wed, 17 Dec 2003, Nate Lawson wrote: > On Wed, 17 Dec 2003, Daniel Eischen wrote: > > On Wed, 17 Dec 2003, Nate Lawson wrote: > > > On Wed, 17 Dec 2003, Daniel Eischen wrote: > > > > Does this fix something other than bacula? > > > > > > Anyone else who expected this semantics. I have no specific examples. > > > > I think it probably only pertinent to writing to tape devices > > where a 0 return means end of tape. Otherwise you should Do mean "writing to tape devices with a broken device driver that returns 0 to mean end of tape". POSIX seems to be clear enough saying that write() returns -1 except on successful completion. I don't believe write() with a nonzero count is successful if it can write nothing. > > get -1 with an appropriate errno or just wait until all > > the requested data has been written. > > > > I asked if this fixed something because I was asked if this > > was a 5.2R candidate. > > Oh, I thought it mattered for people doing non-blocking writes from a > thread also. Non-blocking writes (if supported by whatever is behind the file descriptor) are required to return -1 and EAGAIN if they don't succeed. Historical implementations returned 0, but this was fixed in the first version of POSIX.1. Bruce