• Andrew Morton's avatar
    [PATCH] Fix POSIX timers to give CLOCK_MONOTONIC full · 2f98681f
    Andrew Morton authored
    The POSIX CLOCK_MONOTONIC currently has only 1/HZ resolution.  Further, it is
    tied to jiffies (i.e.  is a restatment of jiffies) rather than "xtime" or the
    gettimeofday() clock.
    
    This patch changes CLOCK_MONOTONIC to be a restatment of gettimeofday() plus
    an offset to remove any clock setting activity from CLOCK_MONOTONIC.  An
    offset is kept that represents the difference between CLOCK_MONOTONIC and
    gettimeofday().  This offset is updated when ever the gettimeofday() clock is
    set to back the clock setting change out of CLOCK_MONOTONIC (which by the
    standard, can not be set).
    
    With this change CLOCK_REALTIME (a direct restatement of gettimeofday()),
    CLOCK_MONOTONIC and gettimeofday() will all tick at the same time and with
    the same rate.  And all will be affected by NTP adjustments (save those which
    actually set the time).
    2f98681f
posix-timers.c 35.1 KB