views:

338

answers:

1

Hi,

I am trying to use timerfd_create and timerfd_settime under Debian Linux lenny. The manpage says to include <sys/timerfd.h>. This file cannot be located on my System. According to the Debian Package Search the only packages with a timerfd.h are the linux-headers-* packets.

I have installed the packets linux-headers-2.6.26-1-amd64 and linux-headers-2.6.26-1-common. I tried including the /lib/modules/2.6.26-1-amd64/build/include/linux/timerfd.h file (and not including <sys/timerfd.h>). But then I get the following linker error:
slave.c:(.text+0x166): undefined reference to timerfd_ceate
slave.c:(.text+0x1e5): undefined reference to timerfd_settime

My build command was gcc -o slave slave.c -L../libs -lcan -lutils -lrt

The can and utils libraries are my own. Non of them use or define one of the timerfd_* functions. I tried -lrt because timer_create and timer_settimer need it, even if its not in the manpage. A test programm with timer_create and timer_settimer works without problems and as expected.

What packets do I need to install, what library do I need to link to, and what include files do I need to use timerfd_create and timerfd_settimer.

Thanks Edger

+3  A: 

Support for these functions is new in linux and glibc, you need linux kernel 2.6.25 or better and glibc 2.8 or higher.

Robert Gamble
Just as a side note, came across this on google, totally solved my problem, thanks!
icco