From nobody Mon Dec 06 15:55:19 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 EF9F718C410A; Mon, 6 Dec 2021 15:55:22 +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 4J77LK1467z4ZtF; Mon, 6 Dec 2021 15:55:21 +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 44E8D68BC; Mon, 6 Dec 2021 15:55:19 +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 1B6FtJbx032789; Mon, 6 Dec 2021 15:55:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6FtJY6032788; Mon, 6 Dec 2021 15:55:19 GMT (envelope-from git) Date: Mon, 6 Dec 2021 15:55:19 GMT Message-Id: <202112061555.1B6FtJY6032788@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: 5fb6ac34479d - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 5fb6ac34479dc0e23b5ff8f3ae74c6266cf32476 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638806122; 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=2Ih77cixNF97iE2yC15qbb1K9lkVqOZkzEZn++sC4+o=; b=CbsYD0cYA0BFpBC8fzYQPVBSsIZ0pPh548ca98rG+Uz9YGYcu8EkZ7o/GUotTdIpctKkob 2LHxz2oWSBB4fr6K7nbJN1IyoASNukaRZjUfRcafxvd9FnJ9w+3UBjw122h7F/JqELC0KK CqUAOKlUFeV5Ilt/QM0gNONj8ZyTMU1esdbQVpwDrqvCFE6nyOp0+N1RsNhBdqLlsKHWIG 65PMBWehN2HIHgHN5EM+jHPcjY5ZtTHjwwjoYFXsxnuJqKFAdvBSpk8mUjSPd0GrgIFeQR YwqBUTh/uzEnrW/4WIIc/BClX0TqOKYFCxNDUFEW/uki6tn7SY7CHR6e22Wkpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638806122; a=rsa-sha256; cv=none; b=ogixAUBRcUmRzP/JBMRVpsAKjmVwbQEmoejscBHp2x57hi56BfDSsWQMUJ6tyzrQd8Ld6s NQF5PZd4Ok7coFj/eRy0NXVIEawD4PDAkmE9MJKdDaisUKuKLxIajObBNGJqFryDT2Wxpc fxkQ/Jud5bUJXXzdsxEOcJ8mdabvp+zqRxyJSudCY2yMt42MlYTf9cAEkZ6HDpeXw3mZuD 9REfyOSK4qMAd/9m4zwy+x1Mpt8wnx63zvVZfiBER1NpyuCQSr75+D8+qFkLjMbuYMOJ7I +EHOPKxXaGCxyKXsn1aonjjWLUahOdvEK4Jp1uUzgCZ2q0IXhLyFBa5iJxEsxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5fb6ac34479dc0e23b5ff8f3ae74c6266cf32476 commit 5fb6ac34479dc0e23b5ff8f3ae74c6266cf32476 Author: Warner Losh AuthorDate: 2021-11-24 09:25:47 +0000 Commit: Warner Losh CommitDate: 2021-12-06 15:54:10 +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 d17b9db27561..316ac606cf5a 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -161,6 +161,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. */ @@ -205,12 +206,14 @@ struct file { #define FOFFSET_LOCKED 0x1 #define FOFFSET_LOCK_WAITING 0x2 #define FDEVFS_VNODE 0x4 +#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 */ @@ -230,6 +233,7 @@ struct xfile { int _xf_int_pad3; int64_t _xf_int64_pad[6]; }; +#endif /* __BSD_VISIBLE */ #ifdef _KERNEL