public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Michael Kerrisk \(man-pages\)" <mtk.manpages@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man <linux-man@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	arul.jeniston@gmail.com, "devi R.K" <devi.feb27@gmail.com>,
	Marc Lehmann <debian-reportbug@plan9.de>,
	John Stultz <john.stultz@linaro.org>,
	Andrei Vagin <avagin@gmail.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>
Subject: Re: timer_settime() and ECANCELED
Date: Thu, 02 Apr 2020 15:35:02 +0200	[thread overview]
Message-ID: <87bloanh89.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <8ae32d2f-e4a8-240f-c7bd-580c26bba2d0@gmail.com>

"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.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!

  reply	other threads:[~2020-04-02 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  9:01 timer_settime() and ECANCELED Michael Kerrisk (man-pages)
2020-04-01 11:16 ` Cyrill Gorcunov
2020-04-01 17:42 ` Thomas Gleixner
2020-04-02  5:34   ` Michael Kerrisk (man-pages)
2020-04-02  8:49     ` Thomas Gleixner
2020-04-02 13:16       ` Michael Kerrisk (man-pages)
2020-04-02 13:35         ` Thomas Gleixner [this message]
2020-04-02 19:48           ` Michael Kerrisk (man-pages)
2020-04-02 20:12             ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bloanh89.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=arul.jeniston@gmail.com \
    --cc=avagin@gmail.com \
    --cc=debian-reportbug@plan9.de \
    --cc=devi.feb27@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox