hello all,
I require a schedule_timeout function statement to have kernel module sleep for 5 minutes. I require to call a function from kernel module from interval of 5 minutes.
For that i have written simple kernel module that should print string in function and that function be called in a interval of 1 minute but its printing continually without sleeping.
regards,
parag.
#define MODULE
#define __KERNEL__
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
void reader()
{
char *buffer1="Timeout";
printk(KERN_DEBUG "buffer in file_reader is =%s\n",buffer1);
}
int init_module (void)
{
int i=0;
while(i<5)
{
reader();
schedule_timeout(600000);
i++;
}
return 0;
}
void cleanup_module(void)
{
printk(KERN_DEBUG "GoodBye Kernel\n");
}
MODULE_LICENSE("GPL");