haskell / haskell/unix

setFileTimesHiRes apparently can receive EINTR

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
documentation help wanted type: enhancement
Dominant language
Haskell
Stars
124
Forks
99
PR merge metrics
No merged PRs in 30d

Description

`man utimensat` doesn't document it (at least on Ubuntu 16.04 -- but [this page](https://www.mkssoftware.com/docs/man3/futimens.3.asp) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.