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

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to