3 ms·
Making open() returning EINTR possible on regular FS is not really cleaning up bad interfaces. Is there even a precedent on any Unix for that behavior?
by temac 6y ago
Making open() returning EINTR possible on regular FS is not really cleaning up bad interfaces. Is there even a precedent on any Unix for that behavior?
- tom_ 6y agoIt's part of the documented POSIX interface, so correct code has to handle it: https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/o...
- cesarb 6y agoOnly if the signal that was caught isn't using SA_RESTART: https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/s... ("If set, and a function specified as interruptible is interrupted by this signal, the function shall restart and shall not fail with [EINTR] unless otherwise specified.") Therefore, correct code can also not handle EINTR as long as it uses SA_RESTART for all non-fatal signals. That's probably the most common case (nobody likes EINTR).