This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/21004] fread/fwrite does not handle EINTR correctly


https://sourceware.org/bugzilla/show_bug.cgi?id=21004

--- Comment #2 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Florian Weimer from comment #1)
> POSIX specifies that fread sets errno on failure, so the EINTR case can at
> least be detected.
> 

Hmm I see, the man page does not mention that.
But Posix IEEE Std 1003.1-2001 does.

> Are you concerned about short reads which are not a multiple of the element
> size?  Recovery from EINTR would be difficult under such circumstances.
> 

Yes.  And what happens with fscanf in case of EINTR.

I am just wondering, if any application is able to handle
this error, or what it would need to do to be on the safe side.

Everything is fine if only SA_RESTART signals are used, which
is the usually the case, though.

> We can't make fread simply ignore EINTR because too many things would break.

What exactly would break?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]