Closed ryandesign closed 1 year ago
utimensat
is POSIX since 2001 (same thing as in #519 ), and declared in fcntl.h
.
Why is it not available?
I think it's easy to not include SRFI 170 based on configure flags (but not system.c
).
macOS 10.13 (2017) is the earliest version of macOS that includes utimensat
.
utimensat
is POSIX.1-2008. macOS (since version 10.5 (2007)) is a certified UNIX 03 (a.k.a. POSIX.1-2001) operating system.
It's probably OK to substitute utimes()
. Not all file systems guarantee nanosecond precision anyway.
It's probably OK to substitute
utimes()
. Not all file systems guarantee nanosecond precision anyway.
I suppose this could work fine if it's done selectively (if utimensat
is not supported, use utimes
)...
Not all file systems guarantee nanosecond precision
Right. macOS used to use HFS+, a.k.a the Mac OS Extended file system. It was introduced in Mac OS 8.1 in 1998 and it has second precision. macOS 10.12.4 introduced APFS, the new Apple File System. It has nanosecond precision. macOS 10.13 is the first version to support booting from APFS volumes. I guess there was no need to have a utimensat
function prior to then.
I suppose this could work fine if it's done selectively (if
utimensat
is not supported, useutimes
)...
Could autoconf check for it and define HAVE_UTIMENSAT
?
Could autoconf check for it and define
HAVE_UTIMENSAT
?
Isn't this easier with an #if defined(something)
? There could be some symbol that, when defined, means we use (or not use) utimensat
I have added a test in autoconf for utimensat
, and wrote some code (with a resolution of 1s) for systems without this primitive. I hope it works (simulated the absence of utimensat
). So, I close this issue.
Feel free to reopen it if something is incorrect
stklos 1.70 and git master fail to build on older versions of macOS:
Here is a full build log from macOS 10.12: https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/222826/steps/install-port/logs/stdio
Can 170.c survive without
utimensat
? If so, you probably want a configure test to check if it exists before you use it in 170.c.