LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to use c functions in linux kernel mode (https://www.linuxquestions.org/questions/linux-software-2/how-to-use-c-functions-in-linux-kernel-mode-203813/)

pwangee 07-11-2004 04:22 PM

how to use c functions in linux kernel mode
 
Hi,

I used some c functions in my program such as pow, log, puts. When I try to make the program work as a module, it gives some errors.

% /usr/local/sbin/click-install wp-wire-dem.click
/usr/local/lib/click.o: unresolved symbol pow
/usr/local/lib/click.o: unresolved symbol log
/usr/local/lib/click.o: unresolved symbol puts
/usr/local/lib/click.o: unresolved symbol printf
click-install: ‘/sbin/insmod /usr/local/lib/click.o’ failed

Can I use the c functions in the kernel program? If can, how to use it? Thanks

Peng
:confused:

paulsm4 07-11-2004 09:47 PM

No - you generally cannot use standard C library functions in kernel code.

I'm not sure if the math functions "pow" or "log" can be made to work safely; the stdlib functions "puts" and "printf" absolutely cannot be used in kernel code.

pwangee 07-11-2004 11:23 PM

hi,

I think that "pow" and "log" can't be used in kernel. So I have to write it by myself. But do you know how to implement them? or do you know where I can get the source code?

Thanks
Peng


All times are GMT -5. The time now is 11:53 PM.