From nobody Mon Dec 06 15:56:37 2021 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 7834518C5D5D; Mon, 6 Dec 2021 15:56:43 +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 4J77Mq30tKz4bdx; Mon, 6 Dec 2021 15:56:39 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 35EC568C8; Mon, 6 Dec 2021 15:56:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B6Fub3Q033763; Mon, 6 Dec 2021 15:56:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6Fubsc033762; Mon, 6 Dec 2021 15:56:37 GMT (envelope-from git) Date: Mon, 6 Dec 2021 15:56:37 GMT Message-Id: <202112061556.1B6Fubsc033762@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: 793fad727a33 - stable/13 - sys/file.h: Allow inclusion when compiling for a strict namespace 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 793fad727a33a5f539eb414e4f0b09aaee0a1b23 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638806200; 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=koemQ+qXDn5TBKOTYY8sFzzYJ8wyZf+bygj2WEdErLQ=; b=bQZoWhh9hljpV1P7N9nd7Xjq9ThaaHSYqwXJK9g1fCs46vSgMIKPCpETyl56Kno79jJCDL Lzpe2JlbWrSWxTcTGBlSQtbcASIl6ZAYO2jj+6AI48l6Vc62V8Wnuf5lV2CTGGYJSBYCuP 6nqz+OfThXqYGdgGxnr4IPxOBq9ROEexthQUIzrJXoDNivOQ57ChfE30aFet/42O5SNhux 8Q24lgayseozb5XWLCMKZmvxrdUnyT+ctFHv1k4gwsN0loQtmfDWiyZdqIt/Ld45s+dP2E ls7DPusvaXZhwzETnEh1Ql4/lS6/WKzNzPqcTwDBeLQrPb8/r0ZyuGS3S+RNEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638806200; a=rsa-sha256; cv=none; b=AaklpXB7gslzF7OVtlDhO0ARTza5Os5fEMxMCR901oXvsMJ9ODRXDISSfyywthk6yIGiS/ oD+KM3HRXrO8RfZ0r1E28u6GGWsukOCkdoFVB32gYA9+OK1szSonHWEKyt/q+NmE3V+bQm /pXWR5y+ygFTMXpMgiSoS07vGi/fiFG6CmL2WaZ/GgFjAm45wGJo5354z0bSlNPyWFH0XJ qGVLMEllygyFPPSzeCZUahiy2DzCy/d3qgUOmX63jQle7nJrZKSHARcBUwl0CHndud5/eF ceigiLNFkSd+pvf2tg4BRD9vlNuGSDCBppYKFTTaaliGPyTj3hy8Xq/PjI64EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=793fad727a33a5f539eb414e4f0b09aaee0a1b23 commit 793fad727a33a5f539eb414e4f0b09aaee0a1b23 Author: Warner Losh AuthorDate: 2021-11-24 09:25:47 +0000 Commit: Warner Losh CommitDate: 2021-12-06 15:55:58 +0000 sys/file.h: Allow inclusion when compiling for a strict namespace Although not part of the standard, this file is sometimes included with -D_POSIX_C_SOURCE= or -D_XOPEN_SOURCE=. Limit those sturctures that use types hidden by __BSD_VISIBLE to when they are visible. PR: 259975, 234205 Sponsored by: Netflix (cherry picked from commit a2b53e53a3f38dd89b64500a2d2a1727baffe4f9) --- sys/sys/file.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/file.h b/sys/sys/file.h index b16e23bdfbcf..c97841d1a108 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -170,6 +170,7 @@ struct fileops { * none not locked */ +#if __BSD_VISIBLE struct fadvise_info { int fa_advice; /* (f) FADV_* type. */ off_t fa_start; /* (f) Region start. */ @@ -209,12 +210,14 @@ struct file { #define FOFFSET_LOCKED 0x1 #define FOFFSET_LOCK_WAITING 0x2 +#endif /* __BSD_VISIBLE */ #endif /* _KERNEL || _WANT_FILE */ /* * Userland version of struct file, for sysctl */ +#if __BSD_VISIBLE struct xfile { ksize_t xf_size; /* size of struct xfile */ pid_t xf_pid; /* owning process */ @@ -234,6 +237,7 @@ struct xfile { int _xf_int_pad3; int64_t _xf_int64_pad[6]; }; +#endif /* __BSD_VISIBLE */ #ifdef _KERNEL