userlevel header in kernel mode

Tom Carly tcarly at esat.kuleuven.ac.be
Wed Oct 16 16:58:27 EDT 2002


I need the rand() and srand() function from stdlib.h How can I reimplement the 
C library in the kernel?

thx

Tom 

Op woensdag 16 oktober 2002 15:04, schreef u:
> On 2002-10-16T14:24:45+0000, Tom Carly wrote:
> > I want to add a userlevel header (stdlib.h) in a new element and I
> > would like to use this element in kernel mode. I have read the
> > thread 'Adding #includes in new elements' in the mailing list about
> > including userlevel and kernel header files. I still don't
> > understand why this isn't possible.
>
> You can include userlevel headers in userlevel and kernel headers in
> the kernel module. The userlevel headers describe things in the C
> library, kernel headers describe stuff in the running kernel.
>
> CLICK is an abstracation of both.
>
> There is no C library in the kernel, and there is no kernel access in
> userspace (besides syscalls).
>
> You can distinguish what you are compiling with
> #ifdef CLICK_LINUXMODULE
> and
> #ifdef CLICK_USERLEVEL
>
> > Is there really no solution to this?
>
> You can reimplement the C library in the Linux kernel...
>
> Which function from stdlib.h do you need? Maybe there is a replacement
> in the kernel?
>
> Kendy




More information about the click mailing list