• Richard Larocque's avatar
    alarmtimer: Return relative times in timer_gettime · a1b01afa
    Richard Larocque authored
    commit e86fea76 upstream.
    
    Returns the time remaining for an alarm timer, rather than the time at
    which it is scheduled to expire.  If the timer has already expired or it
    is not currently scheduled, the it_value's members are set to zero.
    
    This new behavior matches that of the other posix-timers and the POSIX
    specifications.
    
    This is a change in user-visible behavior, and may break existing
    applications.  Hopefully, few users rely on the old incorrect behavior.
    
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Richard Cochran <richardcochran@gmail.com>
    Cc: Prarit Bhargava <prarit@redhat.com>
    Cc: Sharvil Nanavati <sharvil@google.com>
    Signed-off-by: default avatarRichard Larocque <rlarocque@google.com>
    [jstultz: minor style tweak]
    Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
    [bwh: Backported to 3.2: Add definition of alarm_expires_remaining() from
     commit 6cffe00f ('alarmtimer: Add functions for timerfd support')]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    a1b01afa
alarmtimer.c 20.5 KB