diff options
author | Richard Larocque <rlarocque@google.com> | 2014-09-09 18:31:03 -0700 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-11-05 20:27:43 +0000 |
commit | a1b01afa4324d35da3aaef069ac7220901e0e350 (patch) | |
tree | d5d75f7823554976657f5313f173c666b8de8124 /include | |
parent | d8aaaebbe614171cc12a3fe69a79315ac4e42d98 (diff) | |
download | linux-stable-a1b01afa4324d35da3aaef069ac7220901e0e350.tar.gz linux-stable-a1b01afa4324d35da3aaef069ac7220901e0e350.tar.bz2 linux-stable-a1b01afa4324d35da3aaef069ac7220901e0e350.zip |
alarmtimer: Return relative times in timer_gettime
commit e86fea764991e00a03ff1e56409ec9cacdbda4c9 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: Richard Larocque <rlarocque@google.com>
[jstultz: minor style tweak]
Signed-off-by: John Stultz <john.stultz@linaro.org>
[bwh: Backported to 3.2: Add definition of alarm_expires_remaining() from
commit 6cffe00f7d4e ('alarmtimer: Add functions for timerfd support')]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/alarmtimer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h index 975009e1cbe6..9a9838ad27d4 100644 --- a/include/linux/alarmtimer.h +++ b/include/linux/alarmtimer.h @@ -48,6 +48,7 @@ int alarm_try_to_cancel(struct alarm *alarm); int alarm_cancel(struct alarm *alarm); u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); +ktime_t alarm_expires_remaining(const struct alarm *alarm); /* * A alarmtimer is active, when it is enqueued into timerqueue or the |