From d485c77f203fb0f4cdc08dea5ff81631b51d8809 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 18 Feb 2021 15:43:58 +0200 Subject: Remove #define _KERNEL hacks from libprocstat Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in userspace, assuming that the consumer has an idea what it is for. Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h, sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the same caveat. Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h being unusable in userspace, where it override struct buf with its own definition. Instead, provide struct m_buf and struct m_vnode and adapt code to use local variants. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D28679 --- lib/libprocstat/common_kvm.c | 3 +-- lib/libprocstat/libprocstat.c | 5 +---- lib/libprocstat/zfs_defs.c | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/libprocstat') diff --git a/lib/libprocstat/common_kvm.c b/lib/libprocstat/common_kvm.c index 2889f802775d..0ce2a2900f66 100644 --- a/lib/libprocstat/common_kvm.c +++ b/lib/libprocstat/common_kvm.c @@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _KERNEL #include +#define _WANT_MOUNT #include #include #include @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#undef _KERNEL #include #include #include diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index a2de61855815..7ccf6c343705 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -68,15 +68,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _KERNEL +#define _WANT_MOUNT #include #include #include -#include -#include #include #include -#undef _KERNEL #include #include #include diff --git a/lib/libprocstat/zfs_defs.c b/lib/libprocstat/zfs_defs.c index c41054f05136..66acef743dc4 100644 --- a/lib/libprocstat/zfs_defs.c +++ b/lib/libprocstat/zfs_defs.c @@ -71,7 +71,7 @@ struct vattr { long va_spare; /* remain quad aligned */ }; - +#define _WANT_MOUNT #include #include -- cgit v1.3