Re: time within the kernel

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

 



You can call gettimeofday from within the kernel

#include <linux/time.h>

...

struct timeval t = { 0, 0 };
do_gettimeofday(&t);

...

You'll need to decode from unix time (seconds since 1 Jan 1970) yourself 
though
(as these aren't in the kernel).

~mc

On 05/24/02 21:46, David Stroupe wrote:

> I have a need to acquire the time (day, date, time of day, etc) within 
> my driver.  Is there a way to acconplish this?
>


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


[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