get current time in module problem
From: kernel.lover (cranium.2003_at_gmail.com)
Date: 04/14/05
- Next message: Josef Moellers: "Re: how to find structure size written in kernel?"
- Previous message: kernel.lover: "how to find structure size written in kernel?"
- Next in thread: Peter T. Breuer: "Re: get current time in module problem"
- Reply: Peter T. Breuer: "Re: get current time in module problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Apr 2005 23:47:31 -0700
hello,
Why am i getting oops in following kernel module on RH9 linux
with 2.4.20-8 kernel? I want to print current time in kernel. Is there
any other way to get current time in kernel?
#define __KERNEL__
#define MODULE
#include <linux/module.h>
#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/time.h>
static int __init tt_init(void)
{
struct timeval *mytime=NULL;
do_gettimeofday(mytime);
printk(KERN_DEBUG "sec is = %ld\n",mytime->tv_sec);
return 0;
}
static void __exit tt_exit(void)
{
printk(KERN_DEBUG "Leaving Module\n");
}
module_init(tt_init);
module_exit(tt_exit);
MODULE_LICENSE("GPL");
- Next message: Josef Moellers: "Re: how to find structure size written in kernel?"
- Previous message: kernel.lover: "how to find structure size written in kernel?"
- Next in thread: Peter T. Breuer: "Re: get current time in module problem"
- Reply: Peter T. Breuer: "Re: get current time in module problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|