From owner-svn-src-head@FreeBSD.ORG Thu Jun 25 05:39:51 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BC231065679; Thu, 25 Jun 2009 05:39:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 013948FC19; Thu, 25 Jun 2009 05:39:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-126-113.carlnfd1.nsw.optusnet.com.au (c122-107-126-113.carlnfd1.nsw.optusnet.com.au [122.107.126.113]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5P5djBZ028844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Jun 2009 15:39:47 +1000 Date: Thu, 25 Jun 2009 15:39:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: David Schultz In-Reply-To: <20090623234549.GA6076@zim.MIT.EDU> Message-ID: <20090625151849.W33864@delplex.bde.org> References: <200906201639.n5KGdPhO081114@svn.freebsd.org> <20090620174158.GG2884@deviant.kiev.zoral.com.ua> <20090623221248.GA5445@zim.MIT.EDU> <20090623221053.GT2884@deviant.kiev.zoral.com.ua> <20090623234549.GA6076@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r194538 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 05:39:51 -0000 On Tue, 23 Jun 2009, David Schultz wrote: > On Wed, Jun 24, 2009, Kostik Belousov wrote: >> On Tue, Jun 23, 2009 at 06:12:48PM -0400, David Schultz wrote: >>> [... excessive quoting deleted] >>> Applications are not supposed to use such symbols, but we use them >>> pervasively in system headers specifically to avoid conflicting >>> with symbols an application might define. (Effectively, we >>> consider system headers to be part of the language implementation.) >> >> My interpretation is that we use freestanding environment for the kernel, >> and appropriate requirements shall be fullfilled by kernel code. Freestanding reserves fewer symbols for the implementation. Perhaps this mainly affects library symbols, so we can use printf(9) without having pure namespace conflicts with printf(3). > If that's the case, then how do you propose we cope with the > boilerplate preface to virtually every header file, i.e., like the > following? > > #ifndef _SYS_PRIV_H_ > #define _SYS_PRIV_H_ Use he reserved namespace where needed only. This doesn't include the names of system's own macros and variables, at least at the top level (lower level declarations need some protection, and ones used in application headers like __size_t need to be in the implementation namespace). Normal spelling for spare struct members is s_sparefoo where 's' is short for the struct name. struct siginfo in sys/signal.h uses __spare__ (without even the si prefix :-(). Even this shouldn't be an exception. Names beginning with si_ are reserved if is included, and such a name should be used for the spare field too. Bruce