Subject: Re: CVS commit: src/lib/libkvm
To: Joerg Sonnenberger <joerg@britannica.bec.de>
From: Simon Burge <simonb@NetBSD.org>
List: source-changes
Date: 02/08/2007 03:42:25
Joerg Sonnenberger wrote:

> On Wed, Feb 07, 2007 at 02:19:05PM +1100, Simon Burge wrote:
> > What about using a #define that makes it obvious that it shouldn't be
> > used as well?  For example, sys/sys/kauth_private.h that has:
> > 
> > 	...
> > 
> > 	/*
> > 	 * This file contains a private definition for 'struct kauth_cred'
> > 	 * that must only be used by kern/kern_auth.c and kmem grovellers
> > 	 * like ps(1).
> > 	 */
> > 
> > 	#ifdef _KAUTH_CRED_PRIVATE
> > 	struct kauth_cred {
> > 		...
> > 	}
> > 	#endif /* _KAUTH_CRED_PRIVATE */
> 
> You mean like using
> #ifdef _KERNEL
> ...
> #endif /* _KERNEL */
> for datastructures which are internal to the kernel? Oh wait...

Elad's concern was that he didn't want other parts of the kernel using
that struct directly either.

Not installing the header under /usr/include/sys takes care of userland
programs not using it (mostly, they could "include .../sys/sys.." if
they really wanted to), but kernel compiles use -I(source-tree-sys)/sys
so would need extra protection to stop them accessing the contents of
that struct.

Simon.