Subject: Re: is obsolete?
To: walt <>
From: Garrett D'Amore <>
List: current-users
Date: 03/10/2006 10:52:27
walt wrote:
> Garrett D'Amore wrote:
>> walt wrote:
>>> Given that _KERNEL is defined (as it is in libgtop2) what is
>>> cpp supposed to do with that line?...
>> The short answer is that it is *wrong* for gtop to #define _KERNEL. 
>> That macro should *only* be used by kernel software.
>> If gtop needs some definition that is protected by _KERNEL, then someone
>> needs to figure out a proper way to export it to userland processes
>> without requiring this macro.
> I very much appreciate all of the patient responses to my questions.
> I think I'm finally honing in on the source of my confusion.
> If I can trouble all of you with one more bonehead question I may
> be able to grasp this at last.
> I believe you when you say that gtop shouldn't need to define _KERNEL.
> That just makes common sense (even to me ;o)
> So -- why put headers in /usr/include which honor the _KERNEL macro
> in the first place if userland stuff shouldn't be messing with it?
Because some of these headers are shared between kernel and user
source.  The macro provides a way to "hide" kernel private details,
without having to create two versions of header files.

    -- Garrett

Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
Phone: 951 325-2134  Fax: 951 325-2191