Hello all, 

  I need a way to get the date of my linux machine in seconds and 
nanoseconds. In seconds I know I can you some of the standards function of 
lib C (that give me the date since the "epoch"), but my problem is to get 
the nanoseconds. I was reading about clock_gettime. It seems to solve my 
problem, but when I try to compile and link it, I get an error message like 
that: 

cc     time.c   -o time 
/tmp/ccOKP0zk.o(.text+0x21): In function `main': 
: undefined reference to `clock_gettime' 
collect2: ld returned 1 exit status 
make: *** [time] Error 1 

I know its a linker error, that is, the linker doesn't not know here to find 
this function. 
Doesn't this function belong to the standard gnu libc? 
Have anyone heard about "clock_gettime"? If someone knows how it is 
implemented, I'd appreciate so much. 

Thanks. 

Reply via email to