Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jul 2003 04:14:07 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Sandeep Kumar Davu <sdavu@kent.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kernel hacking
Message-ID:  <3F0AA77F.521FE9C4@mindspring.com>
References:  <3F220AA7@webmail.kent.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F0AA77F.521FE9C4>