[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#485811: Headers out-of-sync with library



Package: libc6
Version: 2.3.6.ds1-13etch5

Hi.

On my etch system, the library headers declare the availability of
POSIX timers, but clock_gettime is not actually in the library.  The
attached program fails to compile with

  /tmp/ccs726Ek.o: In function `main':
  test.c:(.text+0x20): undefined reference to `clock_gettime'
  collect2: ld returned 1 exit status

(Julien, I'm CC-ing you in case there's something weird on this machine
and it turns out it's not actually a bug.)

Regards,

                                        Juliusz

#include <stdio.h>
#include <time.h>
#include <unistd.h>

int
main()
{
#if defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
    int rc;
    struct timespec ts;
    rc = clock_gettime(CLOCK_MONOTONIC, &ts);
    if(rc < 0)
        perror("clock_gettime");
    else
        printf("POSIX timers OK.\n");
#else
    printf("No support for POSIX timers.\n");
#endif
    return 0;
}



Reply to: