DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pthread_kill(PTHREAD)


pthread_kill -- send a signal to a sibling thread

Synopsis

   cc [options] -Kthread file
   

#include <signal.h>

int pthread_kill(pthread_t *thread, int (*sig);

Description

pthread_kill sends the signal sig to the sibling thread thread. If thread is blocking signal sig, the signal will become pending for thread. pthread_kill is the thread analog of kill(S).

The thread parameter is the thread ID of the sibling thread which is to receive the signal. A thread cannot send a signal to a thread in another process (a non-sibling thread).

sig is the signal number of the signal to be sent and is either 0 or a value from the list given in signal(M). If sig is 0 (the null signal), error checking is performed but no signal is actually sent; this can be used to check the validity of thread.

To maintain integrity of the Threads Library implementation, threads cannot send SIGLWP or SIGWAITING.

Return values

pthread_kill returns zero on success. Otherwise, an error number is returned and no signal is sent.

Diagnostics

pthread_kill returns the following value if the corresponding condition is detected:

EINVAL
sig is not a valid signal number or is either SIGLWP or SIGWAITING.

ESRCH
thread cannot be found in the current process.

Standards Compliance

The Single UNIX Specification, Version 2; The Open Group.

References

Intro(PTHREAD), kill(S), pthread_self(PTHREAD), pthread_sigmask(PTHREAD), signal(M), sigwait(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005