Subject: Re: Clean up sha1 file writing

From: "H. Peter Anvin" <[email-masked]>
Date: Sun, 04 Jun 2006 11:25:30 -0700

Linus Torvalds wrote:
> 
> On Fri, 2 Jun 2006, H. Peter Anvin wrote:
>> Linus Torvalds wrote:
>>> Any POSIX-conformant OS/filesystem should always do a full write for a
>>> regular file, unless a serious error happens.
>>>
>> Actually, at least Linux won't, if the object is larger than 2 GB on a 64-bit
>> system :)
> 
> Yeah, true.
> 
> In the end, you should always have the loop. That way, you never have to 
> worry about what kind of file descriptor it is, what kind of filesystem 
> you're running on, and what the limits of ssize_t might be.
> 

Or if you're getting a SIGWINCH in the middle of it.

Any POSIX system will interrupt the transfer and return a short read on 
receiving a signal.

	-hpa