Writes to Hard Disk Going Beyond Capacity

C. P. Ghost cpghost at cordula.ws
Sat Jul 10 21:48:49 UTC 2010

On Sat, Jul 10, 2010 at 11:28 PM, Patrick Donnelly <batrick at batbytes.com> wrote:
> On Sat, Jul 10, 2010 at 2:38 PM, C. P. Ghost <cpghost at cordula.ws> 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


Cordula's Web. http://www.cordula.ws/

More information about the freebsd-questions mailing list