Doubts about timers in linux kernel

Hi ,

      I am trying to learn timers in linux kernel. I am trying to write a program where I can configure a timer to  tick in every 5 seconds and a function should thus exicute in every five seconds. I tried one program with the help of linux/timer.h headerfile but I couldnt get the delay right and my  function exicutes only once.That is my timer acts like a single shot timer. How can I make the timer multi slot \(not single slot , that is what I am trying to say\), Plus How can I calculate the time delay in linux kernel. What is jiffies infact. What is the value of 1 jiffy in seconds . Hoping for help

                     Jayanth. S

(moved to C programming forum).

Please post your existing code.

A good place to start would be the alarm function (man alarm). alarm sends a signal to the process every so many seconds so you need to write a handler to trap that signal and call another function from within it. And post your code also.

Thanks for the reply. But I want a timer in kernel space. We cannot use alarm functions in kernel space. That is why I posted this in linux forum. I want to user add_timer() setup_timer functions in linux/timer.h. I tried in vain . I could only create a single shot alarm .How can I take a multislot alarm in kernel.

No that won't work as I missed the part about kernel space timer...the alarm/pause calls will work only in the context of a user process.