bugmake - Bugs: bug #32485, FILE_TIMESTAMP_HI_RES is not...

 
 

bug #32485: FILE_TIMESTAMP_HI_RES is not properly set on AIX

Submitter:  Olexiy Buyanskyy <olexiyb>
Submitted:  Tue 15 Feb 2011 03:34:21 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  4.0 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 04 Mar 2012 12:36:22 AM UTC, comment #2: 

Support for "alternative" nanosecond timestamps was already added to support Darwin, so adding in AIX support was trivial.

Committed.

Paul D. Smith <psmith>
Group administrator
Tue 15 Feb 2011 10:25:16 PM UTC, comment #1: 

In order to fix this issue I had to change acinclude.m4 to add some additional validation of AIX nanoseconds implementation. See attached patch below

Olexiy Buyanskyy <olexiyb>
Tue 15 Feb 2011 03:34:21 AM UTC, original submission:  

This is kind of follow up of
http://www.mail-archive.com/bug-make@gnu.org/msg02239.html

I think this is true bug in gmake 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

Olexiy Buyanskyy <olexiyb>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #22696:  axi_high_resolution_timestamp_patch.txt added by olexiyb (3KiB - text/plain - patch to support high resolution timestamp on AIX systems)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by olexiyb (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-04 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
    2011-02-15 olexiyb Attached File- Added axi_high_resolution_timestamp_patch.txt, #22696

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code