difference between "do_gettimeofday" and "gettimeofday" - Linux

This is a discussion on difference between "do_gettimeofday" and "gettimeofday" - Linux ; 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 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: difference between "do_gettimeofday" and "gettimeofday"

  1. 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


  2. Re: difference between "do_gettimeofday" and "gettimeofday"

    On Fri, 02 Mar 2007 09:33:42 +0100, Unruh wrote:

    > 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.


    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

  3. Re: difference between "do_gettimeofday" and "gettimeofday"

    Tommy Reynolds writes:

    >On Fri, 02 Mar 2007 09:33:42 +0100, Unruh wrote:


    >> 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.


    >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.


    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)

    >HTH


  4. Re: difference between "do_gettimeofday" and "gettimeofday"

    On Sat, 03 Mar 2007 07:51:53 +0100, Unruh wrote:

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


    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.074630N 117.754195W
    knotgary at knotdonavan dot org http : // www.donavan.org
    "The two most abundant substances in the Universe are hydrogen
    and stupidity." --Frank Zappa, R.A. Heinlein and many others



  5. Re: difference between "do_gettimeofday" and "gettimeofday"

    "Gary G. Taylor" writes:

    >On Sat, 03 Mar 2007 07:51:53 +0100, Unruh wrote:


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


    >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?


    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.


    >--
    >Gary G. Taylor * Pomona, CA * 34.074630N 117.754195W
    >knotgary at knotdonavan dot org http : // www.donavan.org
    >"The two most abundant substances in the Universe are hydrogen
    >and stupidity." --Frank Zappa, R.A. Heinlein and many others




+ Reply to Thread