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?
From tgkill()manpage:
tgkill()
Glibc does not provide wrappers for these system calls; name them using the System call (2).
- .tgid = GETPID();TID = gettid();syscall (SYS_tgkill, tgid, tid, signalname));
As noted in another answer, glibc does not provide wrappers for tkill()or tgkill().
tkill()
You should use instead pthread_kill().
pthread_kill()