diff --git a/src/unix/fs.c b/src/unix/fs.c index 8936ad9d..419961c0 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -205,6 +205,13 @@ skip: # else return futimes(req->file, tv); # endif +#elif defined(_AIX71) + struct timespec ts[2]; + ts[0].tv_sec = req->atime; + ts[0].tv_nsec = (unsigned long)(req->atime * 1000000) % 1000000 * 1000; + ts[1].tv_sec = req->mtime; + ts[1].tv_nsec = (unsigned long)(req->mtime * 1000000) % 1000000 * 1000; + return futimens(req->file, ts); #else errno = ENOSYS; return -1; diff --git a/test/test-fs.c b/test/test-fs.c index cf37ac49..1cc1a7c0 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -2033,6 +2033,9 @@ TEST_IMPL(fs_stat_root) { TEST_IMPL(fs_futime) { +#if defined(_AIX) && !defined(_AIX71) + RETURN_SKIP("futime is not implemented for AIX versions below 7.1"); +#else utime_check_t checkme; const char* path = "test_file"; double atime; @@ -2087,6 +2090,7 @@ TEST_IMPL(fs_futime) { MAKE_VALGRIND_HAPPY(); return 0; +#endif }