Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jun 2001 14:45:11 +0100
From:      "Nick Hilliard" <nick-fbsdhackers@netability.ie>
To:        hackers@freebsd.org
Subject:   Re: trace a library call
Message-ID:  <20010628144511.A50831@euripides.enigma.ie>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010628144511.A50831>