[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5052f8a7-c6b9-be30-878e-053a3d035f7a@gmail.com>
Date: Thu, 2 Apr 2020 21:48:04 +0200
From: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: mtk.manpages@...il.com, linux-man <linux-man@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>, arul.jeniston@...il.com,
"devi R.K" <devi.feb27@...il.com>,
Marc Lehmann <debian-reportbug@...n9.de>,
John Stultz <john.stultz@...aro.org>,
Andrei Vagin <avagin@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>
Subject: Re: timer_settime() and ECANCELED
On 4/2/20 3:35 PM, Thomas Gleixner wrote:
> "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com> writes:
>> NOTES
>> Suppose the following scenario for CLOCK_REALTIME or CLOCK_REAL‐
>> TIME_ALARM timer that was created with timerfd_create():
>>
>> (a) The timer has been started (timerfd_settime()) with the
>> TFD_TIMER_ABSTIME and TFD_TIMER_CANCEL_ON_SET flags;
>>
>> (b) A discontinuous change (e.g. settimeofday(2)) is subsequently
>> made to the CLOCK_REALTIME clock; and
>>
>> (c) the caller once more calls timerfd_settime() to rearm the
>> timer (without first doing a read(2) on the file descriptor).
>>
>> In this case the following occurs:
>>
>> · The timerfd_settime() returns -1 with errno set to ECANCELED.
>> (This enables the caller to know that the previous timer was
>> affected by a discontinuous change to the clock.)
>>
>> · The timer is successfully rearmed with the settings provided in
>> the second timerfd_settime() call. (This was probably an imple‐
>> mentation accident, but won't be fixed now, in case there are
>> applications that depend on this behaviour.)
>
> Clear enough.
>
> Thanks Michael!
Thanks. Committed. (But, next time you change the API. maybe a
man-pages patch to go with that? :-).)
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
Powered by blists - more mailing lists