Subject: Re: CVS commit: src/sys/sys
To: Ben Harris <bjh21@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-userlevel
Date: 05/31/2003 23:32:21
Ben Harris wrote:

> In article <87of1jb9am.fsf@minor-variation.et.reziprozitaet.de> you write:
> >Ben Harris <bjh21@netbsd.org> writes:
> >> Alternatively, don't include <unistd.h>, but hard-code the value of
> >> _SC_PAGESIZE.  This avoids polluting the application's namespace, and
> >> matches existing practice (CLK_TCK in <time.h>).
> >
> >It might be argued that it's matching bad existing practice. 
> 
> Quite possibly.  I'm inclined to at least add an extra definition of
> _SC_PAGESIZE and _SC_CLK_TCK in the relevant places, so that the compiler
> will shout if they ever get out of sync.  Maybe even better would be a
> <sys/sysconf.h> which declares __sysconf() and _SC_*, and is included by
> <time.h>, <sys/shm.h> and <unistd.h>.

I'd certainly be for an extra header that only declares the _SC_* defines.
Are the the _POSIX_* defines ever likely to be needed in a scope where
<unistd.h> isn't included?  A quick glance doesn't seem to show any that
may, but maybe it's worthing thinking about a name for the new header file
that isn't dedicated to just the _SC_* defines.

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/