This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/21004] fread/fwrite does not handle EINTR correctly
- From: "bernd.edlinger at hotmail dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 29 Dec 2016 19:14:14 +0000
- Subject: [Bug stdio/21004] fread/fwrite does not handle EINTR correctly
- Auto-submitted: auto-generated
- References: <bug-21004-131@http.sourceware.org/bugzilla/>
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.