As you are already using interposition, another feature that should be avoid will not hurt ;-)
#include <libc.h>
#include <mach-o/nlist.h>
typedef int (*__syscall_t)(quad_t number, ...);
int main(int argc, const char * argv[]) {
struct nlist nl[1];
bzero(&nl, sizeof(struct nlist) * 2);
nl[0].n_un.n_name = (char *)"___syscall";
if (nlist("/usr/lib/libSystem.dylib", nl) < 0 || nl[0].n_type == N_UNDF) {
fprintf(stderr, "nlist(%s, %s) failed\n",
"/usr/lib/libSystem.dylib",
nl[0].n_un.n_name);
return -1;
}
__syscall_t fcn = (__syscall_t)nl[0].n_value;
return 0;
}
See man nlist(3) for details.