From nobody Wed Nov 24 09:39:23 2021 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 E9676189B8EB; Wed, 24 Nov 2021 09:39: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzbZ36txCz4ny4; Wed, 24 Nov 2021 09:39:23 +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 B436B27A84; Wed, 24 Nov 2021 09:39:23 +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 1AO9dNQV068593; Wed, 24 Nov 2021 09:39:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AO9dNQq068592; Wed, 24 Nov 2021 09:39:23 GMT (envelope-from git) Date: Wed, 24 Nov 2021 09:39:23 GMT Message-Id: <202111240939.1AO9dNQq068592@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: a2b53e53a3f3 - main - sys/file.h: Allow inclusion when compiling for a strict namespace 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: a2b53e53a3f38dd89b64500a2d2a1727baffe4f9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637746764; 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=/AKVeGIAro/+YU/OHcgOPsWPhSHLbEdVvBnIS0fMk3s=; b=Jfym3PMD+E14szmdXuwDE9vZwF+gyyCx8MryTa1Fb6bWA0bFTGRwJPRHx+/Fgz4ZYgrRx1 xvkS77Fc4k+j75d+zg2TGM9fepGImMskGntLmQTIZejEgUzJ6nk1SfIwz2ugdNYss+NQSp v5bKvwAs0jP6Gvi5Y8tw06SHpV8WFC+E9ZAjO89tIFwxFozU/sv71T4t90Sa1Pov8SMJxW vTMLKzYifEgiH8NtcF3ibaLLp9vTUnyxTn99bvWMNNKI5NTO51ceFzCkUI/P7n/Mqd4iWC X+jhSiWOld0Jq3NAcaiJuOz1Gh1DYgg16ISGvYHNp82AbVl3OZGIzDRTph+3Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637746764; a=rsa-sha256; cv=none; b=LX+sh0MQV3xp7bV/ZB6LntLdNpl2rWo+5BBiUQVMorKYhELCBFOupKD0ZZ+zzvHyUCxY3G 74gvpxKsaA5CtoahHDfueIZ+4a0Y+3nFxDlTOZaLuQsW9rwXmuug9u8QA3LzKUvqY07byd X9LfEYySK0/F6ACeX+gdkhKAfCPEg46effQ6vcmgKikN5deam7NhOrWr/5J+beGv4chvLx Nk/86NacPdMAOG57cAKg6ki01JXT90RJVOyw6Shd4KgDLYVYhMZk+ndPXiV5mLFB8x0CF5 FWaJmIMb1F3pmeoc1jT63jacFb6zkEVVqr4qbPmS2f2wu4k1UV/ID8Tavk6v1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2b53e53a3f38dd89b64500a2d2a1727baffe4f9 commit a2b53e53a3f38dd89b64500a2d2a1727baffe4f9 Author: Warner Losh AuthorDate: 2021-11-24 09:25:47 +0000 Commit: Warner Losh CommitDate: 2021-11-24 09:38:09 +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 --- sys/sys/file.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/file.h b/sys/sys/file.h index 5a6f0b1d2071..8c4a2394770d 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -174,6 +174,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. */ @@ -213,12 +214,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 */ @@ -238,6 +241,7 @@ struct xfile { int _xf_int_pad3; int64_t _xf_int64_pad[6]; }; +#endif /* __BSD_VISIBLE */ #ifdef _KERNEL