[plug] kernel programming

Peter F Bradshaw pfb at exadios.com
Wed Mar 24 00:43:58 WST 2004


Hi Parag;

If you are talking about the fopen() function call then you are talking
about libc - and libc is not avaliable in the kernel. In fact only those
functions defined in the kernel (or a module) are avaliable.

Kernel programming and user mode programming are quite different - the
enviroment and the implicit assumptions are different. Its hard to know
why you would need to use fopen() in the kernel but if you really do
then you may want to address what ever you are trying to do by writing a
kernel and corresponding user mode components and doing the nasty stuff
in user mode. There are a few ways to communicate - probably using the
/proc file system is easiest (might be messy though :-).

You did not say which kernel version you are talking about but for 2.4
take a look at:

http://www.linux.org.au/LDP/LDP/lkmpg/index.html
and
http://www.linux.org.au/LDP/LDP/lki/index.html

On Tue, 23 Mar 2004, Parag Nemade wrote:

> hello friends,
> i want to modify kernel source code by adding my own C
> files in net protocol stack but i found that some C
> functions are not supported by kernel include
> directory that is fopen is not found in any of header
> files. what can i do? Also while compiling my own C
> files with kernel files i got warnings that implicit
> declaration of function and function declaration isn't
> a prototype how can i solve it?
> Parag.
>

Cheers

-- 
Peter F Bradshaw, pfb at exadios.com, ICQ 75431157 (exadios).
http://www.exadios.com
PGP public key at http://www.exadios.com/public_key.html
"I love truth, and the way the government still uses it occasionally to
 keep us guessing.  " - Sam Kekovich.



More information about the plug mailing list