Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1743229ybb; Thu, 2 Apr 2020 06:36:26 -0700 (PDT) X-Google-Smtp-Source: APiQypK8jPa8CfUWbePQ/CXaGTBZsMQAJvHXyMUEh7GWfl9S1R8okodrbzJG3iTyXcZzjWVxfpSm X-Received: by 2002:a4a:3150:: with SMTP id v16mr2728477oog.71.1585834586061; Thu, 02 Apr 2020 06:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585834586; cv=none; d=google.com; s=arc-20160816; b=HflK3Nbv+AmFUY/rYmEJnXzyJ+WJVNM7OrLb+3NfFVozJedA2kNLSJTnDpf7N7IyRv a9gdmsvuWLlJYvO2FiSUwpatAksMkGZzRbeHwDppVQJ8q2idIq8MlMUteY3GrQhGv+0K OC3jtz3udWZ7qrufTn7sbJMS2Y1z4HxkRK32GDv2P2RtssY42l5yYgT0VqModw60rT8Z 5bx057zE0pwNx5pDaEb9g22yme5eSnul/bBac+psXgM9zd/S/jAVRG5D+44Ppsvtk5yl +TMdKdp4PIb/AZeBGpmOGmsBFQDD5WDvKZH8HYBKZC0pPiU/6P4lG5tcqfyhu1oBm4ij uUYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=Hn4FzGnoieBoQIon9Z3CkQOOWouXlLUCIFUBDunWF0g=; b=r/InnbXR1P7JF6NEq9GAoZIE/8La0E8RXHgSEEvusbiEgRletVzpABnucJrrGWK7IT U7adAJKtrYx3c7qAs0QNIjgmdJQ8FrEksNZkKimoFC8EkXXB8cG/uk2dqGDPJ1rud9wv s7mxo2muyjhWHsk64e6OP47a/1NQoRfflVn2+6ZWcRsTUluLX5We9OLFhIStpLFx1y1s pDJP2UdDDXQ9y0fySP3wbLVh/oWUIoLEYAdNDvW8qUTlh+OBYCRJI5p3402sycIeGJa+ wVae2+Y/XoT8w1UdnrQ79vr9G3lkk4coi12RJ2VXP/nqXGhRpKiqQD7S5SnNRiq19JUW w/SA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si2589770oto.169.2020.04.02.06.36.12; Thu, 02 Apr 2020 06:36:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388686AbgDBNfH convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Apr 2020 09:35:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:37931 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387752AbgDBNfG (ORCPT ); Thu, 2 Apr 2020 09:35:06 -0400 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jJzzr-0004mg-Ab; Thu, 02 Apr 2020 15:35:03 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id B9B9D100D52; Thu, 2 Apr 2020 15:35:02 +0200 (CEST) From: Thomas Gleixner To: "Michael Kerrisk \(man-pages\)" Cc: mtk.manpages@gmail.com, linux-man , lkml , arul.jeniston@gmail.com, "devi R.K" , Marc Lehmann , John Stultz , Andrei Vagin , Cyrill Gorcunov Subject: Re: timer_settime() and ECANCELED In-Reply-To: <8ae32d2f-e4a8-240f-c7bd-580c26bba2d0@gmail.com> References: <87pncrf6gd.fsf@nanos.tec.linutronix.de> <4c557b44-4e4e-a689-a17b-f95e6c5ee4b0@gmail.com> <87mu7unugh.fsf@nanos.tec.linutronix.de> <8ae32d2f-e4a8-240f-c7bd-580c26bba2d0@gmail.com> Date: Thu, 02 Apr 2020 15:35:02 +0200 Message-ID: <87bloanh89.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Michael Kerrisk (man-pages)" 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!