-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add nanosecond precision to File.utime (UNIX) #15335
base: master
Are you sure you want to change the base?
Add nanosecond precision to File.utime (UNIX) #15335
Conversation
Co-authored-by: Kubo Takehiro <[email protected]>
|
I hope that unlike #9392, this won't drop support for macOS < 10.13, High Sierra |
I suppose it would, assuming What's your concern with MacOS < 10.13? It has been EOL since 2019 so I don't see much reason to keep up support. It might be possible to do something similar to bytecodealliance/rustix#275 to keep old versions supported, but I doubt the effort would be justified. |
The `utimensat` and `futimens` syscalls only appeared in macOS 10.14. To keep some backward compatibility, the x86_64 bindings are fixed to not declare them. We can however assume the syscalls to be present when compiling for aarch64. `Crystal::System::File.utime` now falls back to `utimes` when `futimens` isn't defined. Adds the missing `AT_FDCWD` constant to aarch64-android bindings. Fixes the DragonflyBSD binding.
I kept the legacy syscalls for macOS x86_64 builds to keep support with macOS < 10.14, but use the new ones for aarch64 targets that's only supported since macOS 11+ (hence always fine). I also fixed the aarch64-android and dragonflybsd bindings. |
Reopens #9392 with fixes to the android and solaris bindings, and
#system_utime
has already been updated to support nanosecond precision when available.