Fwd: Re: Regarding Kernel Timers

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

 





Note: forwarded message attached.

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

--- Begin Message ---
Hi
Is the problem is coming for using kernel functions in user space??,
and same functions when i am trying to use in kernel module also giving the same error
u can have a glance at the module where i am using the kernel timers.

#include<linux/module.h>
# include<linux/kernel.h>
# include<linux/stddef.h>
# include<linux/timer.h>
struct timer_list tEntry;
void print(unsigned long data)
{
printk("<1> print called\n");
init_timer(&tEntry);
tEntry.expires = 50;
tEntry.function = print;
add_timer(&tEntry);
}
int init_module()
{
init_timer(&tEntry);
tEntry.expires = 50;
tEntry.function = print;
add_timer(&tEntry);
return 0;
}
void cleanup_module()
{
printk("<1> Cleaning up\n");
del_timer(&tEntry);
}
 
thanks
durga

Thomas Petazzoni <thomas.petazzoni@xxxxxxxx> wrote:
Hello,

durga reddy 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.

The given code is for an user-space application. Why are you trying to
use kernel functions from an user-space application ?

Sincerly,

Thomas
--
Thomas Petazzoni
thomas.petazzoni@xxxxxxxx

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

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


[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