From owner-freebsd-hackers Fri Feb 5 08:28:16 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA08235 for freebsd-hackers-outgoing; Fri, 5 Feb 1999 08:28:16 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA08229 for ; Fri, 5 Feb 1999 08:28:15 -0800 (PST) (envelope-from bright@cadaverene.neptho.net) Received: from cadaverene.neptho.net (IDENT:bright@neptho.net [207.88.23.253]) by freefall.freebsd.org (8.9.2/8.9.2) with ESMTP id IAA06192 for ; Fri, 5 Feb 1999 08:28:14 -0800 (PST) (envelope-from bright@cadaverene.neptho.net) Received: from localhost (bright@localhost) by cadaverene.neptho.net (8.9.1a/8.9.1) with ESMTP id IAA17390; Fri, 5 Feb 1999 08:28:11 -0800 (PST) Date: Fri, 5 Feb 1999 08:28:11 -0800 (PST) From: notso To: Ilhwan Kwon cc: freebsd-hackers@freefall.cdrom.com Subject: Re: [help] creating system calls In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 5 Feb 1999, Ilhwan Kwon wrote: > Hi. > > I am trying to write my own system call functions for BSD. > I am trying to calculate the maximum amount of memory a PC needs > when it is used as a router. > First, I declare "u_long max_memused" in /usr/src/sys/sys/mbuf.h. > void clear_mem_stat __P((void)); ... > I write a small program which includes and calls get_mem_stat > and clear_mem_stat system calls. > > Whe I compile, I get > "get_mem_stat" : undefined reference from the text segent" > "clear_mem_stat" : undefined reference from the text segent" You must add the functions to libc. look at: /usr/src/lib/libc/sys/* you can use your functions without modifing libc if you use the SYSCALL macro stuff to do it in your .c file -Alfred > > What did I do wrong? > Any help on this matter will be greatly appreciated. > > Thanks > -James Kwon > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message