I am looking into one library (google-perftools) that attempts to overload sbrk(2). In Linux libc translates calls, ex. sbrk -> __sbrk (in libc), so one can define their own version, call extern __sbrk and it works.
FreeBSD programs connect to the symbol sbrk@@FBSD_1.0

So what is the way to overload the system call like this would be in linux?:

extern "C" void* __sbrk(ptrdiff_t increment);
extern "C" void* sbrk(intptr_t increment) {
  return__sbrk(increment);
}

Yuri

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to