(stat(...) == -1 || faccessat(...) == -1) && errno == EINTR ?!??

Tobias Bading tbading@web.de
Mon Feb 15 10:02:16 GMT 2021

 > Yes, this is not a POSIX conformance issue.


I don't get it. How is a developer supposed to decide in which cases
EINTR handling is required? Check the man page on every platform the
code is supposed to work on and hope that at least one platform mentions
EINTR if the function is indeed able to fail that way?



On 15.02.21 10:45, Florian Weimer wrote:
> * Tobias Bading:
>>> Returning EINTR in stat would allow relatively straightforward
>>> implementation of a timeout, in case the path resides on a network file
>>> system and the server is unreachable.  So it's not a completely
>>> unreasonable thing to do.
>> Good point.
>>> On the other hand, the cost in lost backwards
>>> compatibility with applications that do not know about this behavior
>>> appears to be pretty high, as this thread shows.
>> What's your interpretation of the POSIX standard? Does it permit such a
>> backwards compatibility breaking change?
> Yes, this is not a POSIX conformance issue.  POSIX also does not make
> any requirements regarding backwards compatibility or bug-for-bug
> compatibility.
> Thanks,
> Florian

More information about the Libc-help mailing list