Subject: Re: kern/5377: sys/system.h inludes lib/libkern/libkern.h for LKM too
To: Chris G. Demetriou <cgd@pa.dec.com>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: netbsd-bugs
Date: 04/29/1998 23:01:38
In message <28018.893877042@dnaunix.pa.dec.com> "Chris G. Demetriou" wrote:
> > Including sys/system.h outside the kernel tree with
> > _KERNEL defined tries to include lib/libkern/libkern.h and
> > fails.
>
> Actually, this makes me wonder:
>
> Why does it ever check _KERNEL at all?
I don't know, ... I guess because struct sysent is declared there (thats
why lkm needs it). Maybe its needed somewhere in userland (debugging/ktrace??)
>
> systm.h is _only_ supposed to be used by kernel (including LKM)
> sources. including it from user-land is not correct...
I agree, but I don't build all kernel objects in the kernel tree.
I'm porting a commercial kernel package which builds on anything
from NSK over NT to NSUX,Solaris,HPUX ... and we've a build procedure
which is the same for all Unix-platforms (it took some time to get it
right for DigitalUnix ...) and there is just no way to compile it in the
Kernel tree. I can workaround it and use -I/sys but I think it shouldn't be
a requirement for building a LKM that the kernel-source is installed.
BTW. I've a clone-device driver, should I send-pr it (after a little
clean up?).
Stefan
>
>
> cgd
--
Stefan Grefen Tandem Computers Europe Inc.
grefen@hprc.tandem.com High Performance Research Center
--- Hacking's just another word for nothing left to kludge. ---