Re: Regarding Kernel Timers

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

 



you are trying to write a user application using kernel function,
which is not possible.
write your code as a kernel loadable module, for writting kernel
loadable modules read: http://sdn.vlsm.org/share/LDP/lkmpg/

-gd


On 4/20/05, durga reddy <sysatus@xxxxxxxxx> wrote:
>  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=6;
> 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

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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