From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 8 04:15:21 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F54637B401 for ; Tue, 8 Jul 2003 04:15:21 -0700 (PDT) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D324043FB1 for ; Tue, 8 Jul 2003 04:15:20 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc01p.dialup.mindspring.com ([209.86.0.57] helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19ZqRK-0001Sc-00; Tue, 08 Jul 2003 04:15:19 -0700 Message-ID: <3F0AA77F.521FE9C4@mindspring.com> Date: Tue, 08 Jul 2003 04:14:07 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Sandeep Kumar Davu References: <3F220AA7@webmail.kent.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4393873c806a2959f03b4d173fd886fec350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@freebsd.org Subject: Re: kernel hacking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2003 11:15:21 -0000 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