Regarding Kernel Timers

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

 



 I want to use kernel timers in my code for calling of specific functions after specified time out.
here i have written a sample code for using timers .but it is giving a error whish has given below.
Source Code:
 
#include<stdio.h>
#include<linux/timer.h>
void  add(int a);
main()
{
struct timer_list mytimer;
init_timer(&mytimer);
mytimer.expires=50;
mytimer.data="">mytimer.function=(void *)add;
add_timer(&mytimer);
}
void  add(int a)
{
int c=a;
printf("added valu is %d",c);
}
 when i am compiling with this command :
gcc -c -I /usr/src/linux-2.4.20-8/include/ timer1.c
it is giving the following error :
In file included from timer1.c:4:
/usr/src/linux-2.4.20-8/include/linux/timer.h:17: field `list' has incomplete type
can any one help me outtt...........
 
thanks
durga

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux