difference between "do_gettimeofday" and "gettimeofday"
What is the difference between do_gettimeofday and gettimeofday? I know
the former is a kernel (module) level routing, and the latter is a
userspace routine, Also gettimeofday has the timezone argument which is
unused, but is there any difference between them functionally.Ie is the
time retrieved by one the same as that retrieved by the other?
Is there any way to use do_gettimofday in user space?
Thanks
Re: difference between "do_gettimeofday" and "gettimeofday"
On Fri, 02 Mar 2007 09:33:42 +0100, Unruh wrote:
[color=blue]
> What is the difference between do_gettimeofday and gettimeofday? I know
> the former is a kernel (module) level routing, and the latter is a
> userspace routine.[/color]
Isn't that enough? No? Ok, here goes:
gettimeofday() is the glibc wrapper routine that invokes the system
call for you; and
sys_gettimeofday() is the system call handler and expects its pointer
arguments to be from the applications process space; and
do_gettimeofday() is the worker-bee routine that accepts kernel-space
address parameters and does its magic.
HTH
Re: difference between "do_gettimeofday" and "gettimeofday"
Tommy Reynolds <Tommy.Reynolds@MegaCoder.com> writes:
[color=blue]
>On Fri, 02 Mar 2007 09:33:42 +0100, Unruh wrote:[/color]
[color=blue][color=green]
>> What is the difference between do_gettimeofday and gettimeofday? I know
>> the former is a kernel (module) level routing, and the latter is a
>> userspace routine.[/color][/color]
[color=blue]
>Isn't that enough? No? Ok, here goes:[/color]
[color=blue]
>gettimeofday() is the glibc wrapper routine that invokes the system
>call for you; and[/color]
[color=blue]
>sys_gettimeofday() is the system call handler and expects its pointer
>arguments to be from the applications process space; and[/color]
[color=blue]
>do_gettimeofday() is the worker-bee routine that accepts kernel-space
>address parameters and does its magic.[/color]
OK, I was just checking that they are essentially the same-- that one does
not somehow get a different time than the other (eg some sort of raw
non-frequency corrected time)
[color=blue]
>HTH[/color]
Re: difference between "do_gettimeofday" and "gettimeofday"
On Sat, 03 Mar 2007 07:51:53 +0100, Unruh wrote:
[color=blue]
> OK, I was just checking that they are essentially the same-- that one does
> not somehow get a different time than the other (eg some sort of raw
> non-frequency corrected time)[/color]
Um, how could that happen since the system time is the only time in the
machine and (if you're smart) it's synced via time servers?
--
Gary G. Taylor * Pomona, CA * 34.074630°N 117.754195°W
knotgary at knotdonavan dot org http : // [url]www.donavan.org[/url]
"The two most abundant substances in the Universe are hydrogen
and stupidity." --Frank Zappa, R.A. Heinlein and many others
Re: difference between "do_gettimeofday" and "gettimeofday"
"Gary G. Taylor" <knotgary@knotdonavan.org> writes:
[color=blue]
>On Sat, 03 Mar 2007 07:51:53 +0100, Unruh wrote:[/color]
[color=blue][color=green]
>> OK, I was just checking that they are essentially the same-- that one does
>> not somehow get a different time than the other (eg some sort of raw
>> non-frequency corrected time)[/color][/color]
[color=blue]
>Um, how could that happen since the system time is the only time in the
>machine and (if you're smart) it's synced via time servers?[/color]
No, there are lots of times-- the time between timer interrupts, the time
in the CPU clock, .... They are all combined to make the system time with
various tweaks to make the system time behave properly. I was checking
whether the do_gettimeofday delivered the same tweaked system time as the
gettimeofday clock does.
I was finding that the system time, ntp synced to a ntp server, was 3ms
fast of gps time ( from a gps receiver PPS on the roof). I was wondering
at the time if it could be the timestamps but am now convinced it is a
really crappy ntp server.
[color=blue]
>--
>Gary G. Taylor * Pomona, CA * 34.074630°N 117.754195°W
>knotgary at knotdonavan dot org http : // [url]www.donavan.org[/url]
>"The two most abundant substances in the Universe are hydrogen
>and stupidity." --Frank Zappa, R.A. Heinlein and many others[/color]