public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timerfd: Support CLOCK_TAI
@ 2026-03-19  6:10 Chris Down
  2026-03-19  9:05 ` Chris Down
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Down @ 2026-03-19  6:10 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: linux-kernel, Alexander Viro, Christian Brauner, Jan Kara,
	Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
	kernel-team

Despite hrtimer and POSIX timers both accepting CLOCK_TAI,
timerfd_create() rejects it. This usually corners userspace into one of
two bad options:

1. Convert TAI deadlines through CLOCK_REALTIME, which reintroduces the
   leap second exposure the application was trying to avoid in the first
   place.
2. Abandon timerfd entirely and use POSIX timers or busy wait approaches
   that do not compose well with epoll based event loops.

Avoid these bad outcomes by allowing timerfd to support CLOCK_TAI. The
underlying hrtimer and k_clock infrastructure already supports this.

With this, epoll based applications can arm TAI based file descriptor
timers natively.

Signed-off-by: Chris Down <chris@chrisdown.name>
---
 fs/timerfd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index 73104f36bcae..278ad4ab65c8 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -404,6 +404,7 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
 	    (clockid != CLOCK_MONOTONIC &&
 	     clockid != CLOCK_REALTIME &&
 	     clockid != CLOCK_REALTIME_ALARM &&
+	     clockid != CLOCK_TAI &&
 	     clockid != CLOCK_BOOTTIME &&
 	     clockid != CLOCK_BOOTTIME_ALARM))
 		return -EINVAL;

base-commit: a989fde763f4f24209e4702f50a45be572340e68
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-20 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19  6:10 [PATCH] timerfd: Support CLOCK_TAI Chris Down
2026-03-19  9:05 ` Chris Down
2026-03-20 17:36   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox