Re: Clean up sha1 file writing
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Jun 4, 2006, 18:25 UTC
- Message-ID
- <4483259A.7090806@zytor.com>
- In-Reply-To
- <Pine.LNX.4.64.0606021416040.5498@g5.osdl.org>
Linus Torvalds wrote:
Show 15 quoted lines
> > 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