Re: [PATCH 2/2] pack-objects: be incredibly anal about stdio semantics

From: Linus Torvalds <torvalds@osdl.org>
Date: 2006-04-03 08:58:35
On Sun, 2 Apr 2006, Jason Riedy wrote:
> 
> If you consider stdio to be a low-level wrapper over syscalls
> that only adds buffering and simple parsing, then passing EINTR
> back to the application is a sensible choice.  I wouldn't be
> too surprised if L4, VxWorks, etc. do something similar.

No, returning EINTR is insane, because stdio has to do re-starting of 
system calls by hand _anyway_ for the "short read" case. 

EINTR really _is_ 100% equivalent to "short read of zero bytes" (that 
literally is what it means for a read/write system call - anybody who 
tells you otherwise is just crazy). 

So any library that handles short reads, but doesn't handle EINTR is by 
definition doing something totally idiotic and broken.

Now, I agree that somebody else might be broken too. I would not agree 
that it's "acceptable". It's craptastically bad library code.

> Anyone with an older HP/UX care to try these patches?  HP/UX 
> may not be sane, but I think it may lack SA_RESTART.  I don't 
> know if stdio calls need restarted, though.

I'd assume that older HPUX is so BSD-based that all signals end up 
restarting. That was the BSD signal() semantics, after all.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Apr 03 08:59:12 2006

This archive was generated by hypermail 2.1.8 : 2006-04-03 08:59:26 EST