Background
In the Mac OS environment, interposition works only for preloaded DLLs, meaning that the Heap Interposition Agent (HIA) can only be preloaded rather than linked with the target as in some other operating systems. (See “Behind the Scenes” on page 10 for more information on interposition and the HIA.)
The HIA makes sure that any environment variables related to preloading are correctly propagated if your program calls execve() or system(). The required Mac OS environment variable is DYLD_INSERT_LIBRARIES.
For all Mac OS releases from El Capitan onwards, however, a new feature System Integrity Protection (SIP) implemented a protocol that disallows passing DYLD_INSERT_LIBRARIES to a protected program or a program that resides in a protected directory. Calls to system() are affected because it is defined as invoking /bin/sh, which is in a SIP-protected directory.