unix: implement uv__fs_futime for AIX 7.1

'futimens' is only implemented on AIX 7.1.  Other functions like
'utimes' and 'utimes' are merely stub functions that return ENOSYS
on AIX 6.1 and below.  Skip test fs_futime for AIX versions below 7.1.

PR-URL: https://github.com/libuv/libuv/pull/811
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Imran Iqbal 2016-03-14 15:20:40 -04:00 committed by Ben Noordhuis
parent a84caf6fd7
commit 4aeed1ac13
2 changed files with 11 additions and 0 deletions

View File

@ -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;

View File

@ -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
}