aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-11-24 09:25:47 +0000
committerWarner Losh <imp@FreeBSD.org>2021-11-24 09:38:09 +0000
commita2b53e53a3f38dd89b64500a2d2a1727baffe4f9 (patch)
tree814c70cafd5a7b6aa7e6fda3b184da683561249a
parentb3fab418301eaadb3b9ac24f9ff295a84521dc54 (diff)
downloadsrc-a2b53e53a3f38dd89b64500a2d2a1727baffe4f9.tar.gz
src-a2b53e53a3f38dd89b64500a2d2a1727baffe4f9.zip
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=<value> or -D_XOPEN_SOURCE=<value>. Limit those sturctures that use types hidden by __BSD_VISIBLE to when they are visible. PR: 259975, 234205 Sponsored by: Netflix
-rw-r--r--sys/sys/file.h4
1 files changed, 4 insertions, 0 deletions
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