Unable to compile a program that calls tgkill

I am trying to write a program that uses tgkill to send a signal to a specific stream, but whenever I compile it with gcc, I get an error message undefined to "tgkill". I tried to compile with -lpthread, but that didn't help. I am googled and googled and cannot come up with any answers. How do I compile it?

+3
source share
3 answers

From tgkill()manpage:

Glibc does not provide wrappers for these system calls; name them using the System call (2).

+5
source

- .
tgid = GETPID();
TID = gettid();
syscall (SYS_tgkill, tgid, tid, signalname));

+4

As noted in another answer, glibc does not provide wrappers for tkill()or tgkill().

You should use instead pthread_kill().

+3
source

All Articles