8 /* Getting the pid/tid pair is not atomic, and could give wrong
9 * result if a fork occurs in a signal handler between the two
10 * syscalls. Use the tgkill syscall's ESRCH semantics to detect
11 * this condition and retry. */
13 tid = syscall0(__NR_gettid);
14 pid = syscall0(__NR_getpid);
15 ret = syscall3(__NR_tgkill, pid, tid, sig);
16 } while (ret<0 && errno == ESRCH);