1 #include <sys/prctl.h> 2 #include <stdarg.h> 3 #include "syscall.h" 4 #ifdef HOOK_ENABLE 5 int __libc_prctl(int op, ...); 6 #endif 7 8 #ifdef HOOK_ENABLE __libc_prctl(int op, ...)9int __libc_prctl(int op, ...) 10 #else 11 int prctl(int op, ...) 12 #endif 13 { 14 unsigned long x[4]; 15 int i; 16 va_list ap; 17 va_start(ap, op); 18 for (i=0; i<4; i++) x[i] = va_arg(ap, unsigned long); 19 va_end(ap); 20 return syscall(SYS_prctl, op, x[0], x[1], x[2], x[3]); 21 } 22