[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_kill

Delivers a signal to a specified thread.

This routine is for Digital UNIX systems only.

Syntax

pthread_kill(
             thread,
             sig );
 


Argument Data Type Access

thread opaque pthread_t read sig integer read


C Binding

#include 

int pthread_kill ( pthread_t thread, int sig);

Arguments

thread
Thread to receive a signal request.
sig
A signal request. If sig is zero, error checking is performed, but no signal is sent.

Description

This routine sends a signal to the specified thread. Any signal defined to stop, continue, or terminate will stop or terminate the process, even though it may be handled by the thread. For example, SIGTERM terminates all threads in the process, even though it may be handled by the thread to which it is sent. The name of the "kill" routine is sometimes misleading, because many signals do not terminate a thread.

The various signals are as follows:


   SIGHUP            SIGPIPE           SIGTTIN

   SIGINT            SIGALRM           SIGTTOU

   SIGQUIT           SIGTERM           SIGIO

   SIGTRAP           SIGUSR1           SIGXCPU

   SIGABRT           SIGSYS            SIGXFSZ

   SIGEMT            SIGURG            SIGVTALRM

   SIGFPE            SIGSTOP           SIGPROF

   SIGKILL           SIGTSTP           SIGINFO

   SIGBUS            SIGCONT           SIGUSR1

   SIGSEGV           SIGCHLD           SIGUSR2


If this routine does not execute successfully, no signal is sent.

Return Values

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [EINVAL] The value of sig is invalid or an unsupported signal value. [ESRCH] The value of thread does not specify an existing thread.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]