The latest patch attached here does not apply unfortunately...
One observation is the patch uses compile time interception which only works for source files we can instrument - so it is not semantically equivalent to the ld wrap option which also replaced calls from stand libraries (for functions such as calloc we are mocking in test.). Maybe that is why some of UTs were failing when we first tried the patch?
For OS X, there is standard practice to simulate ld wrap option as described in TR , section 'Macintosh OS X function wrapping', and I tested it work for me locally, so we can explore that approach. I'll give a stab on this if no one else is interested. This approach requires link to shared library so created
ZOOKEEPER-2505 to track that. I think we can keep the ld wrap option as is and add wrap option simulator for OSX specifically - so we can run c test on mac and meanwhile have minimum impact on other platforms.