From owner-cvs-src@FreeBSD.ORG Fri Jul 30 12:43:20 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19AF316A4CE; Fri, 30 Jul 2004 12:43:20 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 896F343D5D; Fri, 30 Jul 2004 12:43:19 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i6UChIje001595; Fri, 30 Jul 2004 22:43:18 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) i6UChAic028089; Fri, 30 Jul 2004 22:43:14 +1000 Date: Fri, 30 Jul 2004 22:43:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Brooks Davis In-Reply-To: <20040728180711.GA31842@Odin.AC.HMC.Edu> Message-ID: <20040730222815.B2631@epsplex.bde.org> References: <4107E0F6.8060902@samsco.org> <20040728180711.GA31842@Odin.AC.HMC.Edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Scott Long cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: Alfred Perlstein cc: cvs-all@FreeBSD.org cc: Robert Watson cc: Garrett Wollman Subject: Re: cvs commit: src/sys/sys _task.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2004 12:43:20 -0000 On Wed, 28 Jul 2004, Brooks Davis wrote: > On Wed, Jul 28, 2004 at 11:23:02AM -0600, Scott Long wrote: > > 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. This would add 2 style bugs that are not as in /sys/sys/timetc.h: - capitalization of an error message - misspelling of "serviceable" > 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" > #endif > > That would break all the offenders when we branch without forcing us to > deal with yet another thing before 5.3. Another way to properly break them is to put the user-serviceable #error in kernel-only headers like . This shows that mounds of kernel interfaces are exported to userland via the nested pollution in (not just the mutex and task structs which can be obtained without collateral pollution by including just and (and their prerequisites...). I never got much further than the following in cleaning this up: %%% Index: if_var.h =================================================================== RCS file: /home/ncvs/src/sys/net/if_var.h,v retrieving revision 1.80 diff -u -2 -r1.80 if_var.h --- if_var.h 22 Jun 2004 20:13:25 -0000 1.80 +++ if_var.h 23 Jun 2004 02:00:09 -0000 @@ -59,25 +60,22 @@ */ -#ifdef __STDC__ -/* - * Forward structure declarations for function prototypes [sic]. - */ -struct mbuf; -struct thread; +struct ether_header; struct rtentry; struct rt_addrinfo; struct socket; -struct ether_header; -#endif +struct thread; -#include /* get TAILQ macros */ +#include /* XXX XXX */ +#include #ifdef _KERNEL -#include -#include -#endif /* _KERNEL */ -#include /* XXX */ -#include /* XXX */ -#include /* XXX */ +#include /* XXX XXX */ +#include /* XXX XXX */ +#include /* XXX XXX */ +#include /* XXX XXX */ +#else +#include /* XXX */ +#include /* XXX */ +#endif #define IF_DUNIT_NONE -1 %%% (2 XXX's means that the pollution is worse than for 1 XXX.) This may depend on other depollution. Pollution in is especially bad because lots of kernel files depend on it. Bruce