]> git.saurik.com Git - apple/libsystem.git/blobdiff - CompatibilityHacks.c
Libsystem-159.tar.gz
[apple/libsystem.git] / CompatibilityHacks.c
diff --git a/CompatibilityHacks.c b/CompatibilityHacks.c
new file mode 100644 (file)
index 0000000..ac9bb5f
--- /dev/null
@@ -0,0 +1,37 @@
+// See: <rdar://problem/8289209>, <rdar://problem/8351271>, <rdar://problem/8359348>
+
+#include <dlfcn.h>
+
+#if __i386__ || __x86_64__
+
+#define SYM(sym) \
+  __asm__(".globl R8289209$_" #sym "; R8289209$_" #sym ": jmp _" #sym);
+
+/****************/
+
+SYM(close);
+SYM(fork);
+SYM(fsync);
+SYM(getattrlist);
+SYM(getrlimit);
+SYM(getxattr);
+SYM(open);
+SYM(pthread_attr_destroy);
+SYM(pthread_attr_init);
+SYM(pthread_attr_setdetachstate);
+SYM(pthread_create);
+SYM(pthread_mutex_lock);
+SYM(pthread_mutex_unlock);
+SYM(pthread_self);
+SYM(ptrace);
+SYM(read);
+SYM(setattrlist);
+SYM(setrlimit);
+SYM(sigaction);
+SYM(stat);
+SYM(sysctl);
+SYM(time);
+SYM(unlink);
+SYM(write);
+
+#endif