-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Call libc::utimensat directly rather than using filetimes crate #10063
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
base: main
Are you sure you want to change the base?
Conversation
…touch permissions when updating time to now
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #10063 will improve performance by 3.57%Comparing Summary
Benchmarks breakdown
Footnotes
|
| set_file_times(path, atime, mtime) | ||
| #[cfg(unix)] | ||
| { | ||
| if opts.source == Source::Now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment explaining why you are doing this
|
|
||
| #[test] | ||
| #[cfg(target_os = "linux")] | ||
| #[cfg(all(unix, not(target_os = "openbsd")))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not openbsd ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openbsd doesn't have /dev/full
https://man.openbsd.org/MAKEDEV.8
#9870 coincidentally works on linux but does not work on platforms where
UTIME_NOWwhich is originally alongdoesn't fit intou32, such as freebsd.It's not possible to use
UTIME_NOWinutimensatwith the filetimes crate on these platforms. I copied the relevant piece of code being called from filetimes so I can calllibc::utimensatdirectly. Providing a nullptr as the times argument as the same effect as bothtv_nsecfields beingUTIME_NOW.For the tests, OpenBSD doesn't have a
/dev/fullbuttouch /dev/nullessentially tests the same permission issue.