how can i make kernel to sleep for 5 minutes?

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

 




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");




[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