From nobody Tue Sep 5 22:26:15 2023 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 4RgKpw3l40z4sd3S; Tue, 5 Sep 2023 22:26:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RgKpv6vy0z4Pw2; Tue, 5 Sep 2023 22:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693952776; 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=yujNGwS8AznNle115dEGCIbkEpJ4jQDj4Cb9J4oHczA=; b=l1B1goO6W8nOfBOQeZq4xSp1h3M+tNd5ayx3nqgG9SbHwmX0FQa/XNxzllVWsdB7AzuqEU DJzuWNH+O5Y61OHP/QYu3cr4EaIuu7G1vF5cNtriSICRszicO2iAbMDYoGy1X9CqtyLWtm FyxkSobDn2ySqFZbaae+stfQ/am9izjNdMs/xt5tcRfGTZVtEhUvv+ppe/8M6DgIM7ZqNp VFtDkC9TBRkEFwsijX88snYnt1ihZWaGAos06x8jnLVOkmCjvrhyi3uJGPO8tFzdLZKZL0 mh3zGZDa9hy3Y1u8wi398yMei3OgpNeSZ9pBMaNLVUbzBeyNTMNWVtnTcRcYWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693952776; a=rsa-sha256; cv=none; b=dyFYTNtCefjsNTlb8trWIYE0WDW83AM63KktIAvS08uw1O1/w2rnQ7+5DcsiuMWTG4nV+F e4Guvh04EvqT68tIi5xOJdK4kJnRvlb/arOHjnqg17gmF7sBFYQNQIrKvaohuaJeImUcGn SkQc9Pk+vxNaDprRdEsFT8YJp9QQHE1+bv1pYgjkCAw78HNM0DgqD+s6SObQmoAfNn/o26 zAkIBr5zPO14wQ1lqTS82iVk78RlooY7t+gSHKMqKpA90UI9s6DbI763UltpM65+eDFHSg FYNuOW/xcWid0PTiQjXqq0VmY2J1PLU6UGyixizFXrvb2ofwALUY9mUmZ7utgA== 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=1693952776; 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=yujNGwS8AznNle115dEGCIbkEpJ4jQDj4Cb9J4oHczA=; b=dLLT3u6Vm2gE1JOYnBk1+z1tMIFk2q7pIqu2DqRwm7Y7StHDAAB/yTTK+pzRzXEj4ICkO1 y+5ayhkDW17h3Z2EJOalg0pvBQMd0i6mit9GYFk96KBmteVKPEhU7oF7iY/qXR+1r2xvKp Wo8vb41PpWcox+AZEvLvEWx9yl/X8QEdGibTaNZHdxf2aAJGRw8a3D5RjF08Ld9MtG0yjG 7Y5/P1yhDgdu0H8J65J3bnaYCXsUxsEuyXGrAWrvkDNS0AGtNUv70LmxyaJVbpSfo6xXaN 8t7L//fCpSk5nZtv9UQnokbrHwte2EPXnZrFtBAE0qXMeJkxEWrE8jKTQEDPDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RgKpv5v1QzrCB; Tue, 5 Sep 2023 22:26:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 385MQFsB075357; Tue, 5 Sep 2023 22:26:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 385MQF5F075354; Tue, 5 Sep 2023 22:26:15 GMT (envelope-from git) Date: Tue, 5 Sep 2023 22:26:15 GMT Message-Id: <202309052226.385MQF5F075354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: fb5daae920ba - main - timerfd: Namespace pollution adjustments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb5daae920bae84e3eec8175bf9e46304c3b2ae6 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fb5daae920bae84e3eec8175bf9e46304c3b2ae6 commit fb5daae920bae84e3eec8175bf9e46304c3b2ae6 Author: Jake Freeland AuthorDate: 2023-09-05 22:11:50 +0000 Commit: Warner Losh CommitDate: 2023-09-05 22:25:01 +0000 timerfd: Namespace pollution adjustments Do not pollute userspace with , instead declare struct thread when _KERNEL is defined. Include instead of . This causes intentional namespace pollution that mimics Linux. g/musl libcs include in their , exposing clock gettime, settime functions and CLOCK_ macro constants. Ports like Chromium expect this namespace pollution and fail without it. MFC After: 3 days Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D41641 --- sys/sys/timerfd.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/sys/timerfd.h b/sys/sys/timerfd.h index 8cb9939ba60f..cace3b71498c 100644 --- a/sys/sys/timerfd.h +++ b/sys/sys/timerfd.h @@ -30,8 +30,12 @@ #include #include -#include -#include +/* + * We only need , but glibc pollutes the namespace + * with . This pollution is expected by most programs, so + * reproduce it by including here. + */ +#include typedef uint64_t timerfd_t; @@ -54,6 +58,8 @@ __END_DECLS #else /* _KERNEL */ +struct thread; + int kern_timerfd_create(struct thread *td, int clockid, int flags); int kern_timerfd_gettime(struct thread *td, int fd, struct itimerspec *curr_value);