From nobody Sun Oct 01 04:41:58 2023 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 4Ryryt5jnDz4wHG9; Sun, 1 Oct 2023 04:41:58 +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 4Ryryt5D8Dz3DNv; Sun, 1 Oct 2023 04:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696135318; 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=okEzIn0baRUBYj4N0V0ESunPZg6HUi7fdIh0nAcQzi8=; b=KdWSPWOeidJeK3+jX2aovL0Z2h5/4bWu6VF1c5MESRzSGh/mCmZYJxv5E24XuS3TGTyLgi oEXcahdgzTtYK9J96cMgZ1/4M+fn1YDi8VYWkTI0Cj4tIihcwM/+GNOudQ15q1hiZwu/3y ScQCfuQynmJULwzTE3Y/TD04dzjn5DF9ZnBg3C92wz3M7jBXeNfr/+LMo+GxKD7z0G+4Mt Ufmyexmxp0zrvRADAAZdI8X0uyqXSqj5WZeNig6ihzcMJlHIspU48SPqjw+9qzyaPMkg3w KOQPoLq8pcrzVxhLsPWp3HTcgs4VAu/4Lbo7cshM3cAMOmXbZruyNOHo50mYfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696135318; a=rsa-sha256; cv=none; b=hivmey3rGmjvE6cTuoh9YE92SMg4U2yzJZmcaMOqWT87yWF/H2fEdMmCRt7wByb28CuCNw /HiuEqTWiQpQkcVd+ofEYWLPdKtlKm8nffwTb6IkluiS7+pkFjev9/0EoeNY10wFiQD4ms mCKtseV2id3VW6bdq9fBL4n2ev5IK9MyAjkInTxj6M3ZTxvK6KB1nro7M8IlxLBMxH7N8M mYBzZiiMD8ScKEItnoDGB14rE8+aCdx7rg9X6VpfK74FJG3ZHJ+ZFzYKgfPixZO0cZf0WD Z59eVGzgwV5ONajb3qd/z3ULLcBwMmi+g27dqVk9Dn10CZz0NX+4mmDuxoQt4Q== 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=1696135318; 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=okEzIn0baRUBYj4N0V0ESunPZg6HUi7fdIh0nAcQzi8=; b=GFnE15qAlxzX8aCUHuBniJ6CKf/IL/1bjQjGRxaMUrdCVbjLOcoQ/4qb9V7uwNs13YNtzf W426uiV+6EQ0mkF7NkYELKn9NdtHSxXPJRzIksNYoLFq/4ChQ4KBBUjOQHn4eGIgufxfMy vyNOZznloLeKW3qwU19MeYLL9qSjGox1FQw1JWGrYzFMB/aSkThgcqChYGvUB9X4JC9pJa z2hX7Dzb65HMmkCN1WabBXV+kWFQaQmwcL1lT6/6Y9MRQRglSDP8TIT5CMNF/Zxw75stv7 38hkyMLapHOCRYRcSWkcdICf5LuKBpvQ3A9byVkD9VWnKc2PYiuQQI6FC7j4ag== 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 4Ryryt4GjPz1rt; Sun, 1 Oct 2023 04:41:58 +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 3914fw0R023889; Sun, 1 Oct 2023 04:41:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3914fwVS023886; Sun, 1 Oct 2023 04:41:58 GMT (envelope-from git) Date: Sun, 1 Oct 2023 04:41:58 GMT Message-Id: <202310010441.3914fwVS023886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7454117918cd - releng/14.0 - timerfd: Namespace pollution adjustments 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 7454117918cd9f7900d92513a7a4e3ed361987bc Auto-Submitted: auto-generated The branch releng/14.0 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7454117918cd9f7900d92513a7a4e3ed361987bc commit 7454117918cd9f7900d92513a7a4e3ed361987bc Author: Jake Freeland AuthorDate: 2023-09-17 15:02:09 +0000 Commit: Warner Losh CommitDate: 2023-10-01 04:40:03 +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 (cherry picked from commit fb5daae920bae84e3eec8175bf9e46304c3b2ae6) (cherry picked from commit 8bcf9a87c79d8de05bc79ff2f8530bf4a52162ca) Approved-by: re (gjb) --- 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);