1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <errno.h>
- #include <linux/x86_64/syscall.h>
- static long
- __sys_call_internal (long sys_call)
- {
- #if 0
- asm ("mov____0x8(%rbp),%rdi !0x10");
- #else
- asm ("mov____0x8(%rbp),%rax !0x10");
- #endif
- asm ("syscall");
- }
- static long
- __sys_call2_internal (long sys_call, long one, long two)
- {
- #if 0
- asm ("mov____0x8(%rbp),%rdi !0x10");
- asm ("mov____0x8(%rbp),%rsi !0x18");
- asm ("mov____0x8(%rbp),%rdx !0x20");
- #else
- asm ("mov____0x8(%rbp),%rax !0x10");
- asm ("mov____0x8(%rbp),%rdi !0x18");
- asm ("mov____0x8(%rbp),%rsi !0x20");
- #endif
- asm ("syscall");
- }
- int
- __raise (int signum)
- {
- long pid = __sys_call_internal (SYS_getpid);
- if (pid < 0)
- return pid;
- else
- return __sys_call2_internal (SYS_kill, pid, signum);
- }
|