cvs commit: src/sys/sys _task.h

Brooks Davis brooks at
Wed Jul 28 11:07:26 PDT 2004

On Wed, Jul 28, 2004 at 11:23:02AM -0600, Scott Long wrote:
> Robert Watson wrote:
> >On Wed, 28 Jul 2004, Garrett Wollman wrote:
> >
> >
> >><<On Wed, 28 Jul 2004 08:03:16 -0700, Alfred Perlstein 
> >><alfred at FreeBSD.ORG> said:
> >>
> >>
> >>>* Maxime Henrion <mux at> [040728 02:19] wrote:
> >>>
> >>>>Or have a struct ifnet for kernel and a struct xifnet for userland, as 
> >>>>we
> >>>>do in other places.
> >>
> >>>That sounds more correct (xifnet).
> >>
> >>No.  Everything that would legitimately be available in an xifnet
> >>structure is already made available through other interfaces.  The only
> >>reason programs might need to look at a struct ifnet is because they're
> >>mucking about in kernel memory, in which case they need the real one and
> >>not a "sanitized" version.  (This is why I moved struct ifnet to
> >><net/if_var.h> in the first place.) 
> >
> >
> >Some applications and libraries declare their known violation of layering
> >boundaries in the system by #define _KERNEL.  Others structures have
> >special #define's, such as COMPAT_43, _WANT_UCRED, etc.  I'd be happy with
> >either #define _KERNEL or #if defined(_KERNEL) || _WANT_IFNET.
> I'd be quite happy with
> #ifndef _KERNEL
> #error "No user-servicable parts inside"
> or similar as is in /sys/sys/timetc.h.  Either way, pollution bad,
> fluffy bunnies good.

First we need to get our house in order.  I count at least 52 includes
of net/if_var.h in our userland.  We could go ahead and add:

#if defined(BURN_BRIDGES) && !defined(_KERNEL)
#error "No user-servicable parts inside"

That would break all the offenders when we branch without forcing us to
deal with yet another thing before 5.3.

-- Brooks

Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the cvs-src mailing list