summaryrefslogtreecommitdiffstats
path: root/libc/arch-x86/syscalls
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-11-18 15:17:07 -0800
committerJeff Brown <jeffbrown@google.com>2011-11-18 16:40:48 -0800
commit10c8ce59a40a1d8ae8f49145eca365b364aabe58 (patch)
tree5157c1d270cda4e2933a0e7fedf8b5ed6b920f96 /libc/arch-x86/syscalls
parent4b469eae40368913b2841b390dada6c58296c602 (diff)
downloadbionic-10c8ce59a40a1d8ae8f49145eca365b364aabe58.zip
bionic-10c8ce59a40a1d8ae8f49145eca365b364aabe58.tar.gz
bionic-10c8ce59a40a1d8ae8f49145eca365b364aabe58.tar.bz2
Add tgkill syscall.
Use tgkill instead of tkill to implement pthread_kill. This is safer in the event that the thread has already terminated and its id has been reused by a different process. Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9
Diffstat (limited to 'libc/arch-x86/syscalls')
-rw-r--r--libc/arch-x86/syscalls/tgkill.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/libc/arch-x86/syscalls/tgkill.S b/libc/arch-x86/syscalls/tgkill.S
new file mode 100644
index 0000000..99af740
--- /dev/null
+++ b/libc/arch-x86/syscalls/tgkill.S
@@ -0,0 +1,29 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+ .text
+ .type tgkill, @function
+ .globl tgkill
+ .align 4
+
+tgkill:
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ mov 16(%esp), %ebx
+ mov 20(%esp), %ecx
+ mov 24(%esp), %edx
+ movl $__NR_tgkill, %eax
+ int $0x80
+ cmpl $-129, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ ret