|
From: Greg P. <gp...@ap...> - 2009-04-17 23:14:16
|
On Apr 17, 2009, at 2:49 PM, Nicholas Nethercote wrote: > Both the kernel (xnu) and the Libc are open source: > http://www.opensource.apple.com/darwinsource/10.5.6/ Note that some parts of the kernel and Libc are not open-source, but in general everything you need for Valgrind is there. Note that most of Libc's syscall functions are trivial wrappers around the kernel syscall. The wrappers are generated by macros and are hard to find. The best bet is to disassemble the Libc function first; if it does nothing except syscall/sysenter and cerror (which sets errno), then you should go straight to xnu's source. >> ../tests/sys_mman.h:25: error: 'MAP_ANONYMOUS' undeclared (first >> use in this >> function) That's spelled MAP_ANON on Mac OS X. (Also, make sure you set either MAP_PRIVATE or MAP_SHARED; if you set neither or both, mmap() may return an error.) -- Greg Parker gp...@ap... Runtime Wrangler |