1 /* $OpenBSD: gadgetsyscall.h,v 1.1 2019/11/27 17:15:36 mortimer Exp $ */ 2 3 pid_t gadget_getpid() { 4 pid_t ans = 0; 5 #if defined(__amd64__) 6 asm("mov $0x14, %%eax; syscall; mov %%eax, %0;" :"=r"(ans)::"%eax", "%ecx", "%r11"); 7 #endif 8 return ans; 9 } 10