Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jul 2004 18:20:52 +0200
From:      Maxime Henrion <mux@freebsd.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/sys _task.h
Message-ID:  <20040728162052.GB13608@elvis.mu.org>
In-Reply-To: <20040728160852.GA21481@Odin.AC.HMC.Edu>
References:  <200407280912.i6S9CsfA088910@repoman.freebsd.org> <20040728091920.GU82302@elvis.mu.org> <20040728160852.GA21481@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Brooks Davis wrote:
> On Wed, Jul 28, 2004 at 11:19:20AM +0200, Maxime Henrion wrote:
> > Maxime Henrion wrote:
> > > mux         2004-07-28 09:12:54 UTC
> > > 
> > >   FreeBSD src repository
> > > 
> > >   Modified files:
> > >     sys/sys              _task.h 
> > >   Log:
> > >   Remove (at least temporarily) the check that prevents us from including
> > >   this file from userland.  Since we export struct ifnet to userland, and
> > >   that struct ifnet now contains a struct task, userland needs to know
> > >   what struct task looks like.
> > >   
> > >   We need to consider having a pointer to a struct task here instead and
> > >   forward declare struct task in the !_KERNEL case.
> > 
> > Or have a struct ifnet for kernel and a struct xifnet for userland, as we
> > do in other places.
> 
> No, that won't work.  There is no valid reason for userland applications
> to use struct ifnet.  They only use it because the authors were lazy
> and access things like interface stats via kvm access to ifnet instead
> of via the generally adaquate sysctls.

I drew the same conclusion after talking to Robert on IRC.  I thought at
least getifaddrs() legitimally needed struct ifnet definition, it seems
it's not the case.  So if there's no sensible use of struct ifnet in
userland, of course it makes a lot of sense to entirely hide it.

> I'm seriously tempted to wrap
> if_var.h in something like, at least once we get our useland clean:
> 
> #if defined(_KERNEL) || defined(IF_VAR_H_IS_NOT_A_VALID_USERLAND_INTERFACE)

Please go for it.

Cheers,
Maxime



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