(stat(...) == -1 || faccessat(...) == -1) && errno == EINTR ?!??
Godmar Back
godmar@gmail.com
Sun Feb 14 15:14:37 GMT 2021
Tobias,
my assessment would be that this is the wrong email list - what you
describe, if correct, would be a kernel bug.
Specifically, inside the kernel, most system calls are restartable
(and should be restarted if `SA_RESTART` is given), but occasionally
you find a place where the kernel implementor decided that they can't
restart the system call, in which case `EINTR` is propagated to user
land. I've encountered this personally in the past with
`tcsetattr()`.
Now whether it is indeed impossible for the implementor to safely
restart the call or not depends on the specific implementation details
(and path taken through the kernel).
Your choices are, in my opinion:
- to handle `EINTR` in user mode
- to file a bug (and propose a fix) against the kernel. You'd need to
look in https://github.com/torvalds/linux/tree/master/fs/cifs for
places where they set something to `-EINTR` and then fail to turn it
into `-ERESTARTSYS` and do not have good reason to do so. I suspect
this would require in-depth knowledge of the cifs file system code.
Bringing up POSIX may not be the most fruitful course of action, and
asking for compensation in the C library (as in doing an automatic
restart in the C library system call wrapper) is generally not a good
idea to my knowledge.
My 2c.
- Godmar
More information about the Libc-help
mailing list