[Bug 292496] linux_timer_create error when using LINUX_CLOCK_MONOTONIC

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 16 Jan 2026 13:42:54 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292496

Warner Losh <imp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |imp@FreeBSD.org

--- Comment #1 from Warner Losh <imp@FreeBSD.org> ---
> After the commit, linux_to_native_clockid started returning CLOCK_UPTIME. Next, CLOCK_UPTIME is passed to kern_ktimer_create (sys/kern/kern_time.c), which returns EINVAL when checking if (clock_id < 0 || clock_id >= MAX_CLOCKS), since MAX_CLOCKS = 5 and CLOCK_UPTIME is also equal to 5.

But
#define MAX_CLOCKS      (CLOCK_TAI+1)
and
#define CLOCK_TAI               16

In both current and stable. How can MAX_CLOCKS be 5?

Examining the code suggests it should be fine. Can you dig in a little deeper
in your environment to see what's going on?

-- 
You are receiving this mail because:
You are the assignee for the bug.