pthread_kill(3T) manual page
Table of Contents
pthread_kill, thr_kill - send a signal to a thread
cc
[ flag ... ] file ... -lpthread [ library ... ]
#include <signal.h>
#include <pthread.h>
int pthread_kill(pthread_t thread, int sig);
cc [ flag ... ] file ...
-lthread [ library ... ]
#include <signal.h>
#include <thread.h>
int thr_kill(thread_t thread, int sig);
MT-Safe
Async-Signal-Safe
pthread_kill()
sends the sig signal to the thread designated by thread. thread must be
a member of the same process as the calling thread. sig must be one of the
signals listed in signal(5)
; with the exception of SIGLWP,
SIGCANCEL,
and SIGWAITING
being reserved and off limits to thr_kill() or pthread_kill().
If sig is 0, a validity check is done for the existence of the target thread;
no signal is sent.
thr_kill() performs the same function as pthread_kill().
Upon successful completion, pthread_kill() and thr_kill()
return 0; otherwise, they return an error number. In the event of failure,
no signal is sent.
- ESRCH
- No thread was found that corresponded to
the thread designated by thread ID
.
- EINVAL
- The sig argument value is not
zero and is an invalid or an unsupported signal number.
kill(2)
,
sigaction(2)
, pthread_self(3T)
, pthread_sigmask(3T)
, raise(3C)
, signal(5)
Although pthread_kill() is Async-Signal-Safe with respect to the Solaris
environment, this safeness is not guaranteed to be portable to other POSIX
domains.
Table of Contents