cvs commit: src/sys/sys _task.h

Max Laier max at love2party.net
Wed Jul 28 09:15:02 PDT 2004


On Wednesday 28 July 2004 18:08, 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'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)

Strongly seconded! Everything the userland needs to know about interfaces 
should come from sysctls or <net/if.h> via ioctls.

-- 
/"\  Best regards,			| mlaier at freebsd.org
\ /  Max Laier				| ICQ #67774661
 X   http://pf4freebsd.love2party.net/	| mlaier at EFnet
/ \  ASCII Ribbon Campaign		| Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: signature
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20040728/f4d5f82d/attachment.bin


More information about the cvs-src mailing list