Re: Conflict between sys/sysproto.h stdio.h ... ?

2003-11-20 Thread Terry Lambert
lucy loo wrote:
 I am writing a kernel loadable module to reimplement some system calls.
 I have included sys/sysproto.h, sys/systm.h, etc. -- very standard
 header files for kld implmentation.

So far...

 I also want to do file i/o in this module, therefore I need to include
 stdio.h. But it obviously conflicts with those sys/..., and make
 won't pass.  Anyone knows how to fix this?

You cannot use libc functions in the kernel.  The kernel does not
link against libc.  It is not an application, it is a kernel.

There are some libc functions which are provided in the kernel;
there are other libc functions for which there are similar kernel
functions of the same name (e.g. printf), and there are some
libc functions -- quoted because they aren't really there, but
you can use them -- that are inlined by the compiler.

Programming in the kernel environment is not the same as programming
in the normal applications environment (the POSIX environment).

-- Terry
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Conflict between sys/sysproto.h stdio.h ... ?

2003-11-18 Thread lucy loo
I am writing a kernel loadable module to reimplement some system calls. I have 
included sys/sysproto.h, sys/systm.h, etc. -- very standard header files for kld 
implmentation. I also want to do file i/o in this module, therefore I need to include 
stdio.h. But it obviously conflicts with those sys/..., and make won't pass. 
Anyone knows how to fix this? 
 
Thanks! 


-
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Conflict between sys/sysproto.h stdio.h ... ?

2003-11-18 Thread Bruce M Simpson
On Tue, Nov 18, 2003 at 12:39:37AM -0800, lucy loo wrote:
 I am writing a kernel loadable module to reimplement some system calls. I have 
 included sys/sysproto.h, sys/systm.h, etc. -- very standard header files for kld 
 implmentation. I also want to do file i/o in this module, therefore I need to 
 include stdio.h. But it obviously conflicts with those sys/..., and make won't 
 pass. 

RTFM - particularly style(9), do not include userland headers in the kernel.

BMS
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]