Skip to content

Instantly share code, notes, and snippets.

@ymmt2005
Created December 25, 2013 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ymmt2005/8120885 to your computer and use it in GitHub Desktop.
Save ymmt2005/8120885 to your computer and use it in GitHub Desktop.
Kill a specific thread externally by using tgkill(2).
#include <signal.h>
#include <sys/syscall.h> /* For SYS_xxx definitions */
#include <sys/types.h>
#include <unistd.h>
int main() {
pid_t tgid=18456;
pid_t tid=24671;
return syscall(SYS_tgkill, tgid, tid, SIGABRT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment