1570af302Sopenharmony_ci#include <sys/prctl.h> 2570af302Sopenharmony_ci#include <stdarg.h> 3570af302Sopenharmony_ci#include "syscall.h" 4570af302Sopenharmony_ci 5570af302Sopenharmony_ci#ifdef HOOK_ENABLE 6570af302Sopenharmony_ciint __libc_prctl(int op, ...); 7570af302Sopenharmony_ci#endif 8570af302Sopenharmony_ci 9570af302Sopenharmony_ci#ifdef HOOK_ENABLE 10570af302Sopenharmony_ciint __libc_prctl(int op, ...) 11570af302Sopenharmony_ci#else 12570af302Sopenharmony_ciint prctl(int op, ...) 13570af302Sopenharmony_ci#endif 14570af302Sopenharmony_ci{ 15570af302Sopenharmony_ci unsigned long x[4]; 16570af302Sopenharmony_ci int i; 17570af302Sopenharmony_ci va_list ap; 18570af302Sopenharmony_ci va_start(ap, op); 19570af302Sopenharmony_ci for (i=0; i<4; i++) x[i] = va_arg(ap, unsigned long); 20570af302Sopenharmony_ci va_end(ap); 21570af302Sopenharmony_ci return syscall(SYS_prctl, op, x[0], x[1], x[2], x[3]); 22570af302Sopenharmony_ci} 23