Re: finishing the if.h/if_var.h split
From: Doug Rabson (dfr_at_nlsystems.com)
Date: 09/30/03
- Previous message: John Baldwin: "Re: adding if_dev member to struct ifnet"
- In reply to: Bruce Evans: "Re: finishing the if.h/if_var.h split"
- Next in thread: Garrett Wollman: "Re: finishing the if.h/if_var.h split"
- Reply: Garrett Wollman: "Re: finishing the if.h/if_var.h split"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Bruce Evans <bde@zeta.org.au> Date: 30 Sep 2003 18:25:38 +0100
On Tue, 2003-09-30 at 09:22, Bruce Evans wrote:
> That's one alternative. (Far too) many places already use the simple
> alternative of just using "struct device *". Grep shows 68 lines
> containing "struct device" in *.h and 32 in *.c. For "device_t", the
> numbers are 2140 in *.h and 5089 in *.c. This is in a sys tree with
> about 1000 matches of "device_t" in generated files. There are non-bogus
> uses of "struct device" to avoid namespace pollution in <sys/rman.h>.
> Most other uses are just bogus (modulo the existence of device_t being
> non-bogus -- its opaqueness is negative since anything that wants to
> use it must include <sys/bus.h> and thus can see its internals. style(9)
> says to not use negatively opaque typedefs).
The internals of struct device are not contained in <sys/bus.h> - it is
completely opaque to users outside subr_bus.c. The main 'bug' here is
the idea that its a good thing to export kernel data structures (struct
ifnet) to userland. The layout of struct ifnet is an implementation
detail - it shouldn't form part of the userland api.
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
- Previous message: John Baldwin: "Re: adding if_dev member to struct ifnet"
- In reply to: Bruce Evans: "Re: finishing the if.h/if_var.h split"
- Next in thread: Garrett Wollman: "Re: finishing the if.h/if_var.h split"
- Reply: Garrett Wollman: "Re: finishing the if.h/if_var.h split"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|