Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2011 16:27:49 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r223029 - head/usr.sbin/makefs/ffs
Message-ID:  <20110613161452.S843@besplex.bde.org>
In-Reply-To: <201106130104.p5D140VF048748@svn.freebsd.org>
References:  <201106130104.p5D140VF048748@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110613161452.S843>