-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syscalls: minimally implement tgkill
The golang applications use the tgkill syscall to implement the raise() function as the issue #1047 describes. The raise() function is then used to propagate SIGTERM signal to the process when Ctrl-C is pressed. For that reason this patch adds very basic implementation of the tgkill syscall. More specifically it only handles the case where tpid specifies current process or -1 and tid specifies the current thread of the caller which in essence is what Golang raise() passes. In this case the tgkill syscall implementation delegates to kill() otherwise it returns failure. This patch also modifies the implementation of the pthread_kill() to make it consistent with the implementation of the tgkill syscall. The pthread_kill is actually called by raise() (see libc/pthread.cc) so just like with tgkill, we check if specified pthread_t is equal to the current thread and in such case we delegate to kill(). Lastly this patch enhances tst-kill.cc to test raise() and pthread_kill(). Refs #1047 Signed-off-by: Waldemar Kozaczuk <[email protected]> Message-Id: <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters