svn commit: r223029 - head/usr.sbin/makefs/ffs
Bruce Evans
brde at optusnet.com.au
Mon Jun 13 06:27:58 UTC 2011
On Mon, 13 Jun 2011, Dimitry Andric wrote:
> Log:
> Apparently makefs needs a few more system headers to compile during
> buildworld.
This expands the bug.
> Modified:
> head/usr.sbin/makefs/ffs/ffs_bswap.c
> head/usr.sbin/makefs/ffs/ffs_subr.c
>
> Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c
> ==============================================================================
> --- head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 00:55:29 2011 (r223028)
> +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 01:04:00 2011 (r223029)
> @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
>
> #include <sys/param.h>
> #include <sys/queue.h>
> +#include <sys/lock.h>
> +#include <sys/lockmgr.h>
> #if defined(_KERNEL)
> #include <sys/systm.h>
> #endif
Kernel variables like sn_lock should not be exported to userland. And
even when they are, the full kernel API for accessing them should not
by included by userland (or in kernel headers). The system provides
headers <sys/_lock.h> and <sys/_lockmgr.h> to help avoid exposing the
full API.
These bugs are in many networking headers, but should not be added in
new code. The networking headers are so convuluted and broken that
many of them have to expose the full API. This should be even easier
to avoid adding in new code.
Bruce
More information about the svn-src-head
mailing list