Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setFileTimesHiRes apparently can receive EINTR #86

Open
nh2 opened this issue Feb 18, 2017 · 0 comments
Open

setFileTimesHiRes apparently can receive EINTR #86

nh2 opened this issue Feb 18, 2017 · 0 comments

Comments

@nh2
Copy link
Member

nh2 commented Feb 18, 2017

man utimensat doesn't document it (at least on Ubuntu 16.04 -- but this page seems to do for futimens), but it seems that utimensat() can return errno = EINTR when interrupted.

This just occurred to me when sending SIGSTOP (Ctrl-Z) to my program and then resuming:

setFileTimesHiRes: interrupted (Interrupted system call)

If it can really return EINTR, we'd have to change

setFileTimesHiRes name atime mtime =
  withFilePath name $ \s ->
    withArray [toCTimeSpec atime, toCTimeSpec mtime] $ \times ->
      throwErrnoPathIfMinus1_ "setFileTimesHiRes" name $
        c_utimensat (-100) s times 0

to use throwErrnoIfMinus1Retry_ instead.

@nh2 nh2 changed the title setFdTimesHiRes apparently can receive EINTR setFileTimesHiRes apparently can receive EINTR Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants