On Tue, Jan 22, 2008 at 06:17:29PM +0530, Kathiresan, Lekshmanan wrote:
>    I want to print current date and time in a kernel module.  
> 
>   1) do we have direct functions that we could use in kernel?

No.

>    2) Can get time from epoch using gettimeofday? So, how do I convert
> it to the current date and time string. Is there something similar to
> 
>      userspace ctime in kernel?

You don't. The kernel doesn't have an idea about current date and time.
Date and time depends on timezone rules, and that's userspace. If you
need date and time of your local timezone in your kernel module, your
module is broken by design.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

Attachment: signature.asc
Description: Digital signature

Reply via email to