comp.lang.ada
 help / color / mirror / Atom feed
From: Lionel Draghi <lionel.draghi@gmail.com>
Subject: Re: GNAT Modification_Time limitation
Date: Tue, 20 Nov 2018 03:57:42 -0800 (PST)
Date: 2018-11-20T03:57:42-08:00	[thread overview]
Message-ID: <7938d434-d666-4b80-a5cb-6c2f8ee70153@googlegroups.com> (raw)
In-Reply-To: <04221674-95d8-4d4a-8743-42877b13eead@googlegroups.com>

Thank you guys for your answers :

@Shark : see the description of my app hereafter, I will try the simple way first :-)

@Keith and Emmanuel : the Time_Of call I put in my message comes from the body of Ada.Directories (/opt/GNAT/2018/lib/gcc/x86_64-pc-linux-gnu/7.3.1/adainclude/a-direct.adb) :

...

Date := File_Time_Stamp (Name);
GM_Split (Date, Year, Month, Day, Hour, Minute, Second);
return Time_Of (Year, Month, Day, Hour, Minute, Second, 0.0);
...

and GM_Split (in System.OS_Lib package) is calling      

procedure To_GM_Time
        (P_Time_T : Address;
         P_Year   : Address;
         P_Month  : Address;
         P_Day    : Address;
         P_Hours  : Address;
         P_Mins   : Address;
         P_Secs   : Address);
      pragma Import (C, To_GM_Time, "__gnat_to_gm_time");

P_Secs is pointing an Integer.

So the limitation seems to come from GNAT C interface to OS lib.


@Keith : my App is (in this first version) using strace, so thanks for the stat idea, I should directly get the OS time stamp from strace output.

 

@Emmanuel : my make is a POC to do a make without makefile! :-)

it runs command and observes files accesses (thanks to linux kernel ptrace interface), and automatically understand what files it depends on, and what files are output.

My first test case is to replace this Makefile:

all: hello

hello.o: hello.c
    gcc -o hello.o -c hello.c

main.o: main.c hello.h
    gcc -o main.o -c main.c

hello: hello.o main.o
    gcc -o hello hello.o main.o

with just :

gcc -o hello.o -c hello.c
gcc -o main.o -c main.c
gcc -o hello hello.o main.o

and to get the same optimized behavior when removing a .o file or touching one of the source files.

-- 
-- Lionel

  reply	other threads:[~2018-11-20 11:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 22:56 GNAT Modification_Time limitation Lionel Draghi
2018-11-20  0:47 ` Shark8
2018-11-20  1:33   ` Keith Thompson
2018-11-20  1:33 ` Keith Thompson
2018-11-20 23:32   ` Randy Brukardt
2018-11-21  8:23     ` Dmitry A. Kazakov
2018-11-20  8:08 ` briot.emmanuel
2018-11-20 11:57   ` Lionel Draghi [this message]
2018-11-21  7:40     ` briot.emmanuel
2018-11-21 11:16       ` briot.emmanuel
2018-11-21 19:13         ` Lionel Draghi
2018-11-21 19:02       ` Lionel Draghi
2018-11-21 19:48         ` Simon Wright
2018-11-21 22:14           ` Lionel Draghi
2018-11-20 23:53   ` Randy Brukardt
2018-11-21  7:31     ` briot.emmanuel
2018-11-21 14:38       ` Shark8
2018-11-21 17:32       ` Simon Wright
2018-11-21 17:43         ` briot.emmanuel
2018-11-21 23:34       ` Randy Brukardt
2018-11-22  8:15         ` briot.emmanuel
2018-11-26 23:45           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox