Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jun 2009 15:39:46 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        David Schultz <das@FreeBSD.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten <ed@FreeBSD.org>
Subject:   Re: svn commit: r194538 - head/sys/sys
Message-ID:  <20090625151849.W33864@delplex.bde.org>
In-Reply-To: <20090623234549.GA6076@zim.MIT.EDU>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <signal.h> is included, and
such a name should be used for the spare field too.

Bruce



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