From nobody Sat Apr 25 16:32:18 2026 X-Original-To: dev-commits-src-all@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 4g2wN828t9z6bmGS for ; Sat, 25 Apr 2026 16:32:24 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g2wN74XHPz46pV for ; Sat, 25 Apr 2026 16:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777134743; 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=1kybdYphXCl6WNQWQ6zjSaDcBeAl0H1TkUtiFvgi5Mg=; b=RswAbF4SoT/Ps29mIyTkeHn5XrHjHzQ8kMEvj+GvySr808VlPNDcUOqw1ry9CvhWl2xn+3 zXQRBsnXoba8iVZf96jh+mAtAiX+xn8qKMjK5pSbueaDtbQysxi4acoZSxRumvpxBJgdHk QjO8SZpkUN8GEuhMWnQCUr4yo0OLLdg/wVrqk80Il+hMDeO56WzXdeZSPun35VDy2wAxeN IvYKI4OXdn6e2Q/xf8yGuy4cR8v380++7C3gnbvx6P/t1Ln2Y0n/xbaiI1UD4Q6TZsBB30 FVrjy3sdtk4l4PEJM/g1MZlzf+6/F8XyVwvM0IcCDpnYk16tO3CfFvdso2sVWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777134743; a=rsa-sha256; cv=none; b=EG9f7R//3pOB78/xDD+PGg9clR8kJHQiHzhJDcl3kXUOnir9PVNe4R10mZl4e3qU2n2oV/ lZy0NI4wrglL29TmWfnJRToUnLrdDiYzuh6Y+6kkD/8UDs+L+TdQ2TnTpqqTsMLHbQEovd JNcsQ6K51bSCj/GfUEsReK7APmlKvexTIc8zPLSeOLpGLCWlTkhocpu9PW5uQsLVkwXTO7 +oNVoTc052YD9ANd7vZIvxQ7vG4/UTfoBYkQ8KO3tepal14y/gZpeZnHDaWbWk2xjPOqeT P+zimNTar8d/AoF8md66WKZZoVZgWeRZSwyYOQPhjZjnAxVFX5QUWK7bpcES2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777134743; 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=1kybdYphXCl6WNQWQ6zjSaDcBeAl0H1TkUtiFvgi5Mg=; b=sz4ApJwVgvl+C11LRgr2bEOMghQguIO4a7u8bq7I3s/HEkmzg/B/VPCdEKgBdSXOarmIn1 CtHU4a78RiESHu3q60iaH7m7C/EqwTnPTFSQ2zMwBewJ65RrLED1Tvr3MceYEQsr0sNnzC J0EMFYe/PZiHsAxUBObBCdzY2jGSgTlYawjhJhF/UqmDOscI+VQXkSpPQEjhz90smRlRn0 4zE9nXdWVnNRLH4K7o9nIFb85yGRG1LnTkK/rFoRZkvfBP2icboghcbUkt8+65xqjJOXJ6 SaNKZ1fs0egHtT6kEhSyiwkEix0nIRqjtq5BKG5eoTXUOLaTPXW3jyn1gZk56g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2wN73vSHzhpQ for ; Sat, 25 Apr 2026 16:32:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4614e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Apr 2026 16:32:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: f8162575f211 - stable/15 - libnetbsd: add math.h and sys/time.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f8162575f2114c26e52753ece0fac9738b97a79e Auto-Submitted: auto-generated Date: Sat, 25 Apr 2026 16:32:18 +0000 Message-Id: <69ecec92.4614e.72c4489c@gitrepo.freebsd.org> The branch stable/15 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=f8162575f2114c26e52753ece0fac9738b97a79e commit f8162575f2114c26e52753ece0fac9738b97a79e Author: Enji Cooper AuthorDate: 2026-02-25 23:19:56 +0000 Commit: Enji Cooper CommitDate: 2026-04-25 16:32:11 +0000 libnetbsd: add math.h and sys/time.h - `math.h`: `isinff(..)` - `sys/time.h`: `timespec*(x)` These two headers are used by tests in newer snapshots of `contrib/netbsd-tests`. MFC after: 1 week (cherry picked from commit 2a6c2d9c38dc421025b6c18cac68fe9965c574c0) --- lib/libnetbsd/math.h | 14 ++++++++++++++ lib/libnetbsd/sys/time.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/lib/libnetbsd/math.h b/lib/libnetbsd/math.h new file mode 100644 index 000000000000..bffc94f82d67 --- /dev/null +++ b/lib/libnetbsd/math.h @@ -0,0 +1,14 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 Enji Cooper + */ + +#ifndef __LIBNETBSD_MATH_H__ +#define __LIBNETBSD_MATH_H__ + +#include_next + +#define isinff(x) __isinff(x) + +#endif diff --git a/lib/libnetbsd/sys/time.h b/lib/libnetbsd/sys/time.h new file mode 100644 index 000000000000..9ddde16e84e3 --- /dev/null +++ b/lib/libnetbsd/sys/time.h @@ -0,0 +1,35 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 Enji Cooper + */ + +#ifndef _LIBNETBSD_SYS_TIME_H_ +#define _LIBNETBSD_SYS_TIME_H_ + +#include_next + +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#define timespecadd(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ + if ((vsp)->tv_nsec >= 1000000000L) { \ + (vsp)->tv_sec++; \ + (vsp)->tv_nsec -= 1000000000L; \ + } \ + } while (0) +#define timespecsub(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ + if ((vsp)->tv_nsec < 0) { \ + (vsp)->tv_sec--; \ + (vsp)->tv_nsec += 1000000000L; \ + } \ + } while (0) + +#endif