kernel hacking
Terry Lambert
tlambert2 at mindspring.com
Tue Jul 8 04:15:21 PDT 2003
Sandeep Kumar Davu wrote:
> I was making changes to 4.5 source code. I tried to recompile the kernel.
> it compiles well but is not able to link it.
> I used the function inet_aton in uipc_socket.c
> This is the error i got.
>
> uipc_socket.o(.text+0xid8): undefined refernce to '__inet_aton'
>
> I added all the header files that were required.
>
> Can anyone tell what is missing.
You are trying to call a libc function from within the kernel.
In general, you can not use /usr/include headers in kernel
code, only /usr/include/sys headers. This is because the
kernel is not linked againsts libc.
Mostly, you should not be dealing with strings in the kernel;
if you are adding a kernel entry point to be called from user
space, you should convert the address into a sockaddr_in
before you pass it into the kernel, instead.
-- Terry
More information about the freebsd-hackers
mailing list