From nobody Tue Nov 10 00:22:05 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jNnQk3Cynz70kxT for ; Tue, 10 Nov 2026 00:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jNnQk0Qs9z3QfV for ; Tue, 10 Nov 2026 00:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794270126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pD2LDolF4tCGYR3RruF3d7/k/e4n0/yfe/+Id90uCak=; b=jCJpmQbMvIyownZnidJyGdThgyamYwr1bfIwEAFPkqVaMfzIoeTZAwyQm1WgdtWy7Sk2CL No36zGrq1DJ/3MV2HgPTP3mUnT9yCZ8hhudnPD0gOADJeKrPrJVtcHtYKvNnKINUXqvHq9 /pWFXp3zjwUpf7gTjK6ot4EbAzT94b+9s0lSZQgoe+ksfbuYPAuAmJKo8q27XhliazJ/F6 HVtkbXuNhVgrQdCIuPY0zQaXkUddJu/CX9IAfgf18igqmKFW+FJ727yqdwct1kcdJ2BEdU 9bQyZoH0CF+EPdtacu7quGPEUV3oMzg8QD5hSWAIK81+a3ASNrfFVkMzP+K0hg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794270126; b=xIhmPH54iHsQjC/Zeci4qN0ul1LBxZ9Zr11K2V+CFfeKN/sfyqetdqIITe7MkcT1UsDurl 69IEnp/vMFOy7ylc2xCSdnpuQstwNyk0HRa9vmzSpLabvgihFabquheGv9BMBrExTkuIoS 3Udg1+kw9rUhtWUPU3yM+uBp7bi2yYdb+2UOU2ngvo+zrt8yNc6Nctwv6F+9QPXzH65Kcv QX/iaakeyWn+tLBTH2DPBv5/X7XAG6+GTpNcthCGrnsrMnunWOkKuQ13kKLItmSGcoRnno 5ml2/rRJ4dZCz8CnQ+8pVI4lRWMOQA1Zyv2GVa0xrff+phiePTw8pCHld+YxEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794270126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pD2LDolF4tCGYR3RruF3d7/k/e4n0/yfe/+Id90uCak=; b=Zgfr02gwSlsoWXTblHVjZlxu8mMJdPcg+odaNjM1XTQW7TNO5Tn2fa2sihUE/zeSwa/0Qr GAih0BtH+tudWFkQ2jbzv4LqbTi2e7NgiJZAfvwTrnVIWwDuSYBBx2oFvEI3PdUbXv8LJl D92u3XJ7wXr1yeyZ6vtVvDDsbAjIWx4QRPVN0Cjm8yMNN3xNQk7vXCs1Vuw4yeBIJG8TpS HGjkhsTOCPvh0LcJe/MI6tMmdRXKokgYDUHRcv28y/RZqEDMsIoaD/ShX2rXwC7WBAl+Rj JrRcLtnkSDFQZwQXRCft2MyTxhXxvYOdUtMMf8NH4mq1D+bzyXhYmFnv/5EhEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jNnQj6rM0z14Jw for ; Tue, 10 Nov 2026 00:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id f93c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Nov 2026 00:22:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 62e53516f732 - main - lib/libthr: add helper to check valid clockid to use with _umtx_op(2) List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62e53516f73247d2ed80d8dc452f02d9a92575a0 Auto-Submitted: auto-generated Date: Tue, 10 Nov 2026 00:22:05 +0000 Message-Id: <6af263ad.f93c.32f47307@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=62e53516f73247d2ed80d8dc452f02d9a92575a0 commit 62e53516f73247d2ed80d8dc452f02d9a92575a0 Author: Konstantin Belousov AuthorDate: 2026-11-05 20:39:40 +0000 Commit: Konstantin Belousov CommitDate: 2026-11-10 00:21:18 +0000 lib/libthr: add helper to check valid clockid to use with _umtx_op(2) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D61253 --- lib/libthr/thread/thr_private.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index 9ea56b5b8a35..2a9592cdfe46 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -996,6 +996,34 @@ _sleepq_first(struct sleepqueue *sq) return TAILQ_FIRST(&sq->sq_blocked); } +/* + * Must accept the same clocks as umtx_check_clockid() in + * sys/kern/kern_umtx.c. + */ +static inline int +_thr_check_clockid(clockid_t clockid) +{ + switch (clockid) { + case CLOCK_REALTIME: + case CLOCK_REALTIME_PRECISE: + case CLOCK_REALTIME_FAST: + case CLOCK_MONOTONIC: + case CLOCK_MONOTONIC_PRECISE: + case CLOCK_MONOTONIC_FAST: + case CLOCK_UPTIME: + case CLOCK_UPTIME_PRECISE: + case CLOCK_UPTIME_FAST: + case CLOCK_SECOND: + case CLOCK_VIRTUAL: + case CLOCK_PROF: + case CLOCK_PROCESS_CPUTIME_ID: + case CLOCK_TAI: + return (0); + default: + return (EINVAL); + } +} + void _sleepq_init(void) __hidden; struct sleepqueue *_sleepq_alloc(void) __hidden; void _sleepq_free(struct sleepqueue *) __hidden;