From owner-freebsd-questions@FreeBSD.ORG Sat Jul 10 21:48:48 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF482106564A for ; Sat, 10 Jul 2010 21:48:48 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3D28FC17 for ; Sat, 10 Jul 2010 21:48:48 +0000 (UTC) Received: by wwe15 with SMTP id 15so782156wwe.31 for ; Sat, 10 Jul 2010 14:48:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.68.142 with SMTP id l14mr1714586wed.67.1278798510432; Sat, 10 Jul 2010 14:48:30 -0700 (PDT) Received: by 10.216.65.3 with HTTP; Sat, 10 Jul 2010 14:48:30 -0700 (PDT) X-Originating-IP: [93.203.29.70] In-Reply-To: References: <87iq4nsr3a.fsf@kobe.laptop> Date: Sat, 10 Jul 2010 23:48:30 +0200 Message-ID: From: "C. P. Ghost" To: Patrick Donnelly Content-Type: text/plain; charset=ISO-8859-1 Cc: questions@freebsd.org Subject: Re: Writes to Hard Disk Going Beyond Capacity X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 21:48:49 -0000 On Sat, Jul 10, 2010 at 11:28 PM, Patrick Donnelly wrote: > On Sat, Jul 10, 2010 at 2:38 PM, C. P. Ghost wrote: >> >> Or, to be more precise, is it possible that write(2) returns 0 for >> some reason, perhaps because the device isn't ready and can't >> accept more data, so it says that it wrote 0 bytes, but that you >> are free to try again? > > write returning 0 appears to be the problem. That is indeed strange > and I would guess it may be a bug? I don't know if it is a bug at all, and if the standard isn't precise enough and allows this. Granted, write(2) returning 0 for file descriptors that weren't opened with O_NONBLOCK looks pretty weird, and somehow it doesn't "feel" right. Perhaps it happens because you're not writing to a file system (that would catch this?) but to the raw device itself, and the raw device behaves like a tape, a pipe, or a socket in this case? Strange indeed. > - Patrick Donnelly -cpghost. -- Cordula's Web. http://www.cordula.ws/