implement sbrk() by calling hoard's version, through sbrk_hook (fct pointer was named this way in R5).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17540 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2006-05-22 18:04:20 +00:00
parent 712c1e8c39
commit 3ad603ace4
2 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,8 @@
# define CTRACE(x) ;
#endif
extern "C" void *(*sbrk_hook)(long);
void *(*sbrk_hook)(long) = &BPrivate::hoardSbrk;
using namespace BPrivate;

View File

@ -7,10 +7,13 @@
#include <unistd.h>
#include <errno.h>
/* in hoard wrapper */
extern void *(*sbrk_hook)(long);
void *
sbrk(long increment)
{
// this function is no longer supported
if (sbrk_hook)
return (*sbrk_hook)(increment);
return NULL;
}