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

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


On 15.02.21 11:20, Florian Weimer wrote:
 > * Tobias Bading:
 >>> Yes, this is not a POSIX conformance issue.
 >>
 >> o.O
 >>
 >> 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?
 >
 > The issue here is that one Linux file system (CIFS) behaves differently
 > from most other file systems.  That is not something that can be
 > addressed with documentation at the level of the manual pages.
 > Practically speaking, I would say this is a file system bug.

Yes, looks like a file system bug in this case.

But I'm wondering how this is supposed to work in general:
I'm writing some piece of code and are about to call a POSIX function.
How the heck am I supposed to figure out whether EINTR handling is
required if I can't rely on the man page and the POSIX spec?

Tobias



More information about the Libc-help mailing list