The HyperNews Linux KHG Discussion Pages

Question: add_timer function errata?

Forum: Supporting Functions
Date: Mon, 07 Oct 1996 09:45:17 GMT
From: Tim Ferguson <>

It seems that when using the add_timer function in newer versions of the kernel (2.0.0+), the `expires' variable in the timer_list struct is the time rather than the length of time before the timer will be processed. To be backward compatible with older versions of linux, you need to do something like:

if the old version was:
   timer.expires = TIME_LENGTH;

new version would be:
   timer.expires = jiffies + TIME_LENGTH;

where TIME_LENGTH is the time in 1/100'ths of a second.

Could anyone tell me if they found this also to be the case, and if so, could the Linux hackers guide please be updated.

    thanks,
             Tim.


Messages

1. Ok: add_timer function errata by Tom Bjorkholm