Subject: Re: pkg/10616: sparc/cpu.h includes non-installed kernel includes
To: =?iso-8859-1?Q?Jarom=EDr_Dole=E8ek?= <dolecek@ibis.cz>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 08/03/2000 17:35:53
>> i was fiddling with lsof 4.51D (the mother of all kmem grovellers) and
>> it needs it.  when it's processing a vnode, it looks at stuff in there
>> to print out locks on file descriptors, if any.
>
>What it exactly needs ? Does it need the contents of struct lockf ?
>If it needs just stub
>	struct lockf;
>it should not include the <sys/lockf.h> header.

it's actually looking at the stuff in struct lockf, so it needs *that*
structure.  the lf_advlock() function it doesn't need, but it does
need the struct vop_advlock_args stub declaration.  but i repeat
myself.

the code in question looks at the struct lockf to figure out what kind
of lock it is.  it examines lf_flags, lf_id, lf_start, lf_end,
lf_type, and lf_next, leaving very little alone.

>BTW, you might get away with defining _KERNEL and _LKM - the
>"opt_*" are normally only included if _LKM is not defined.

_KERNEL is not mentioned in sys/vnode_if.h and _LKM is not mentioned
at all in either that, or sys/vnode.h.

>> on the other hand...it only needs the forward struct declaration to
>> get rid of the warning from the prototype for lf_advlock(), a function
>> it will *never* call.  if the function prototypes were protected from
>
>It could hardly do so - it's internal kernel function :)

yep.  :)

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."