From owner-freebsd-hackers Thu Jun 28 6:45:18 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from euripides.enigma.ie (euripides.enigma.ie [194.106.143.89]) by hub.freebsd.org (Postfix) with ESMTP id 26DDB37B401 for ; Thu, 28 Jun 2001 06:45:15 -0700 (PDT) (envelope-from nick-fbsdhackers@netability.ie) Received: (qmail 50859 invoked by uid 1009); 28 Jun 2001 13:45:11 -0000 From: "Nick Hilliard" Date: Thu, 28 Jun 2001 14:45:11 +0100 To: hackers@freebsd.org Subject: Re: trace a library call Message-ID: <20010628144511.A50831@euripides.enigma.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Zhihui Zhang wrote: > sbrk() is not supported in FreeBSD as a system call (see file > vm/vm_mmap.c). pancake:/sys> grep -w sbrk /usr/src/sys/kern/syscalls.master 69 STD BSD { int sbrk(int incr); } If you use malloc() in your program, you shouldn't use sbrk, because doing so will make the malloc() code lose count of what memory has been added to the heap. The result of this is that your program will almost certainly crash due to different memory objects being stored in the same area of memory. The version of sbrk in libstand is an emulation of the system call which is not used for any programs running in multiuser mode (or at least, it shouln't be, if it is). Nick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message