[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    pthread_kill(3T) manual page Table of Contents

Name

pthread_kill, thr_kill - send a signal to a thread

Synopsis

Posix

cc [ flag ... ] file ... -lpthread [ library ... ]

#include <signal.h>
#include <pthread.h>
int pthread_kill(pthread_t thread, int sig);

Solaris

cc [ flag ... ] file ... -lthread [ library ... ]

#include <signal.h>
#include <thread.h>
int thr_kill(thread_t thread, int sig);

MT-Level

MT-Safe

Async-Signal-Safe

Description

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().

Return Values

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.

Errors

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.

See Also

kill(2) , sigaction(2) , pthread_self(3T) , pthread_sigmask(3T) , raise(3C) , signal(5)

Notes

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