This is probably safer because it uses APIs. I believe the _dyld* functions are
considered SPIs.
#include <stdio.h>
#include <mach-o/dyld.h>
#include <assert.h>
int main(void) {
NSSymbol symbol;
NSModule module;
symbol = NSLookupAndBindSymbol("_printf");
assert(symbol != NULL);
module = NSModuleForSymbol(symbol);
assert(module != NULL);
printf("Module library name: %s\n", NSLibraryNameForModule(module));
return 0;
}
Original issue reported on code.google.com by malstro...@gmail.com on 1 Jan 2010 at 11:30
Original issue reported on code.google.com by
malstro...@gmail.com
on 1 Jan 2010 at 11:30