[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #32484] FILE_TIMESTAMP_HI_RES is not properly set on AIX
From: |
Olexiy Buyanskyy |
Subject: |
[bug #32484] FILE_TIMESTAMP_HI_RES is not properly set on AIX |
Date: |
Tue, 15 Feb 2011 03:32:08 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13 |
URL:
<http://savannah.gnu.org/bugs/?32484>
Summary: FILE_TIMESTAMP_HI_RES is not properly set on AIX
Project: make
Submitted by: olexiyb
Submitted on: Tue 15 Feb 2011 03:32:07 AM GMT
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 3.81
Operating System: POSIX-Based
Fixed Release: None
Triage Status: None
_______________________________________________________
Details:
This is kind of follow up of
http://www.mail-archive.com/address@hidden/msg02239.html
I think this is true bug in make for AIX. IBM has support of nanoseconds
https://www-304.ibm.com/support/docview.wss?uid=isg3T1012054
it's kept in st_mtime_n.
As a proof I wrote small program
#include <limits.h>
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
int main(int argc, char **argv) {
char resolved_path[PATH_MAX];
if (argc != 2) {
printf("Usage: modtime <path>\n");
return 1;
} else {
struct stat fstat = {0};
if (stat(argv[1], &fstat) == 0) {
printf("Mod time=[%d] [%d]\n", fstat.st_mtime, fstat.st_mtime_n);
return 0;
}
if (errno) {
fprintf(stderr, "modtime: %s: %s\n", argv[1], strerror(errno));
return errno;
}
}
return 255;
}
and run 10 times
> for i in 1 2 3 4 5 6 7 8 9;do modtime GNUmakefile;touch GNUmakefile;done
Mod time=[1297728298] [440567462]
Mod time=[1297728301] [911431115]
Mod time=[1297728301] [916699492]
Mod time=[1297728301] [921435220]
Mod time=[1297728301] [931440190]
Mod time=[1297728301] [936699695]
Mod time=[1297728301] [941444402]
Mod time=[1297728301] [951448241]
Mod time=[1297728301] [957170600]
As you can see st_mtime stayed the same, but nano seconds were changed.
In order to fix this we need to do proper check of FILE_TIMESTAMP_HI_RES on
aix system in configure and modify filedef.h
#if FILE_TIMESTAMP_HI_RES
#if defined(__IBMCPP__) || defined(_AIX) || defined(_AIX_)
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, (st).st_mtime_n)
#else
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, (st).st_mtim.ST_MTIM_NSEC)
#endif
#else
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, 0)
#endif
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?32484>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #32484] FILE_TIMESTAMP_HI_RES is not properly set on AIX,
Olexiy Buyanskyy <=