Hi!
> Actually, I need.
> 
> I use clock_gettime() to get the current time and use it when UTIME_NOW 
> is passed. Like this:
> #if HAVE_UTIMENSAT
>          ret = utimensat(AT_FDCWD, pathname, times, 0);
> #else
>          if (times == NULL) {
>                  ret = utimes(pathname, NULL);
>          } else {
>          /* stat and etc */
> 
>                  ret = clock_gettime(CLOCK_REALTIME, &tp);
>                  if (ret == -1)
>                          tst_brkm(TBROK | TERRNO, cleanup_fn,
>                                  "Failed to clock_realtime() at %s:%d",
>                                  file, lineno);
> 
>          /* handle UTIME_NOW and etc */
>          }
> #endif
> 
> 
> The compilation of safe_file_ops.c performs ok. libltp.a is formed. But 
> compilations of other pieces of code using safe_touch fails with:
> make[1]: Entering directory `/home/stas/ltp/lib/tests'
> gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W 
> -D_FORTIFY_SOURCE=2 -I../../include -I../../include   -L../../lib 
> tst_process_state.c   -lltp -o tst_process_state
> ../../lib/libltp.a(safe_file_ops.o): In function `safe_touch':
> /home/stas/ltp/lib/safe_file_ops.c:213: undefined reference to 
> `clock_gettime'
> collect2: ld returned 1 exit status
> 
> I know, that clock_gettime() requires '-lrt'.
> 
> But I'm not sure about the right place inside LTP sources to put it in....

What about using gettimeofday() instead?

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to