Skip to content

futimens() not provided on macos 10.11 #3335

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

Closed
jakwings opened this issue Sep 28, 2019 · 3 comments
Closed

futimens() not provided on macos 10.11 #3335

jakwings opened this issue Sep 28, 2019 · 3 comments
Labels

Comments

@jakwings
Copy link

jakwings commented Sep 28, 2019

I bumped right into this problem when I ran zig build ....

switch (errno(system.futimens(fd, times))) {

zig/lib/std/fs/file.zig

Lines 272 to 291 in 543e729

/// `atime`: access timestamp in nanoseconds
/// `mtime`: last modification timestamp in nanoseconds
pub fn updateTimes(self: File, atime: i64, mtime: i64) UpdateTimesError!void {
if (windows.is_the_target) {
const atime_ft = windows.nanoSecondsToFileTime(atime);
const mtime_ft = windows.nanoSecondsToFileTime(mtime);
return windows.SetFileTime(self.handle, null, &atime_ft, &mtime_ft);
}
const times = [2]os.timespec{
os.timespec{
.tv_sec = @divFloor(atime, std.time.ns_per_s),
.tv_nsec = @mod(atime, std.time.ns_per_s),
},
os.timespec{
.tv_sec = @divFloor(mtime, std.time.ns_per_s),
.tv_nsec = @mod(mtime, std.time.ns_per_s),
},
};
try os.futimens(self.handle, &times);
}

Is this a strict requirement, and btw what is the minimum version of macos supported by the zig toolchain?

I replaced it with futimes (microsecond precision) and all compiler tests passed.

(maybe related? #1907)

@andrewrk
Copy link
Member

https://ziglang.org/#Support-Table

10.13 is the current minimum

@andrewrk
Copy link
Member

I understand how unsatisfying it is to file your first issue and have it closed immediately.

Unfortunately, macOS has proven to be the most problematic operating system to support. It would be a difficult case to make to increase the supported version range on top of this. I also think it is unreasonable to support a version of the OS that Apple doesn't even support.

@jakwings
Copy link
Author

No problem! Luckily by some little tweaks I can have fun with the latest zig while evaluating the latest osx. :)

Anyway, thanks for the hard work!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants