This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with librt.a - correction


Hi,
I'm making a simple program to calculate the cpu execution time of a
process. I'm using the function clock_gettime like the line below:
...
if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID,  &gtt_wall) != 0)
...
The problem only occur with the clock_id CLOCK_PROCESS_CPUTIME_ID. I'm
using CentOS 4.2.

When I compile my program with gcc using dynamic libraries (gcc -o
test test.c -ltr) the function clock_gettime return 0 ("success"), but
when I compile the program using static libraries (gcc -o test test.c
-static -ltr) the function clock_gettime returns -1 ("Invalid
argument").

Anybody knows why using librt.so the probram works but using librt.a
the program crashes?

Thanks,
Guilherme


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]