• George Anzinger's avatar
    [PATCH] Bugfix for CLOCK_REALTIME absolute timer · 7fe672b1
    George Anzinger authored
    As required by the standard, this patch adds to POSIX ABSOLUTE timers the
    functionality of adjusting the timer when the clock is set so that it still
    expires at the specified time (provided that time has not passed, in which
    case the timer expires immeadiatly).
    
    The standard is, IMNSOHO, a bit vague on just how repeating timers are to
    be handled so I made some choices:
    
    1) If an absolute timer is to expire every N intervals, we assume that
       the expiries should happen at those specified times after clock setting.
        I.e.  we adjust the repeat timer as well as the initial timer.  (The
       other option would be to treat the repeating timers as relative and not
       to adjust them.)
    
    2) If a clock set moves the the clock prior to the initial expiry time
       AND that time has already passed and been signaled, the current repeat
       timer is adjusted, i.e.  we DO NOT go back to the initial time and
       repeat that.  (The other option is to treat this case as a new request
       with the initial timer parameters (which by this time we have lost).)
    
    3) If time is advanced such that it appears that several expiries have
       been missed, the overrun count will reflect the misses.  (The other
       option is to not reflect this in the overrun.) At the same time, nothing
       is done to acknowledge, to the user, that we are repeating expiries when
       the clock is retarded.
    Signed-off-by: default avatarGeorge Anzinger <george@mvista.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    7fe672b1
posix-timers.c 44.7 KB