public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Crowe <mac-6JwzNyXSCK3QT0dZR+AlfA@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mike Crowe <mac-6JwzNyXSCK3QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] epoll_wait.2: Clarify that the timeout is measured against CLOCK_MONOTONIC
Date: Thu, 15 Sep 2016 10:17:53 +0100	[thread overview]
Message-ID: <1473931073-26587-1-git-send-email-mac@mcrowe.com> (raw)

The existing page left the choice of clock as ambiguous. My reading of the
kernel implementation is that CLOCK_MONOTONIC is always used since ep_poll
calls schedule_hrtimeout_range, which calls schedule_hrtimeout_range_clock
passing CLOCK_MONOTONIC.

References:
 http://lxr.free-electrons.com/source/fs/eventpoll.c?v=4.7#L1614
 http://lxr.free-electrons.com/source/kernel/time/hrtimer.c?v=4.7#L1785

The "measured against" terminology was borrowed from nanosleep.2.

I've checked all the way back to Linux v2.6.12 where the calculation was
done using jiffies so I think that this has effectively always been true.

Signed-off-by: Mike Crowe <mac-6JwzNyXSCK3QT0dZR+AlfA@public.gmane.org>
---
 man2/epoll_wait.2 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/man2/epoll_wait.2 b/man2/epoll_wait.2
index 9637906..48bb281 100644
--- a/man2/epoll_wait.2
+++ b/man2/epoll_wait.2
@@ -55,6 +55,9 @@ The
 argument specifies the number of milliseconds that
 .BR epoll_wait ()
 will block.
+Time is measured against the
+.B CLOCK_MONOTONIC
+clock.
 The call will block until either:
 .IP * 3
 a file descriptor delivers an event;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2016-09-15  9:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15  9:17 Mike Crowe [this message]
     [not found] ` <1473931073-26587-1-git-send-email-mac-6JwzNyXSCK3QT0dZR+AlfA@public.gmane.org>
2016-09-20 12:33   ` [PATCH] epoll_wait.2: Clarify that the timeout is measured against CLOCK_MONOTONIC Michael Kerrisk (man-pages)

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=1473931073-26587-1-git-send-email-mac@mcrowe.com \
    --to=mac-6jwznyxsck3qt0dzr+alfa@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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