Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_kill(3) [osf1 man page]

pthread_kill(3) 					     Library Functions Manual						   pthread_kill(3)

NAME
pthread_kill - Delivers a signal to a specified thread. (This routine is available only on a UNIX system.) LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> #include <signal.h> int pthread_kill( pthread_t thread, int sig); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: IEEE Std 1003.1c-1995, POSIX System Application Program Interface PARAMETERS
Thread to receive a signal request. A signal request. DESCRIPTION
This routine sends a signal to the specified target thread thread. Any signal defined to stop, continue, or terminate will stop or termi- nate the process, even though it can be handled by the thread. For example, SIGTERM terminates all threads in the process, even though it can be handled by the target thread. Specifying a sig argument of zero (0) causes this routine to validate the thread argument but not to deliver any signal. 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: Successful completion. The value of sig is invalid or unsupported signal value. The value of thread does not specify an existing thread. ERRORS
None RELATED INFORMATION
Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_kill(3)

Check Out this Related Man Page

PTHREAD_KILL(3) 					     Linux Programmer's Manual						   PTHREAD_KILL(3)

NAME
pthread_kill - send a signal to a thread SYNOPSIS
#include <signal.h> int pthread_kill(pthread_t thread, int sig); Compile and link with -pthread. DESCRIPTION
The pthread_kill() function sends the signal sig to thread, another thread in the same process as the caller. The signal is asynchronously directed to thread. If sig is 0, then no signal is sent, but error checking is still performed; this can be used to check for the existence of a thread ID. RETURN VALUE
On success, pthread_kill() returns 0; on error, it returns an error number, and no signal is sent. ERRORS
ESRCH No thread with the ID thread could be found. EINVAL An invalid signal was specified. CONFORMING TO
POSIX.1-2001. NOTES
Signal dispositions are process-wide: if a signal handler is installed, the handler will be invoked in the thread thread, but if the dispo- sition of the signal is "stop", "continue", or "terminate", this action will affect the whole process. SEE ALSO
kill(2) sigaction(2), sigpending(2), pthread_self(3), pthread_sigmask(3), raise(3), pthreads(7), signal(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2009-01-28 PTHREAD_KILL(3)
Man Page

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help in using SIGUSR1 and SIGUSR2

Thanks just i want to know how i can use the SIGUSR1 and SIGUSR2. can i use it in : signal(SIGUSR1, the name of function ) and if i have the two children can i assign these signals one for each? (5 Replies)
Discussion started by: IT_girl
5 Replies

2. Programming

Program received signal SIGABRT, Aborted.

I ran degugger in C++ and the followings are the message I got: Program received signal SIGABRT, Aborted. 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 (gdb) info s #0 0x002a57a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 0x002e97f5 in raise () from /lib/tls/libc.so.6... (1 Reply)
Discussion started by: napapanbkk
1 Replies

3. Programming

Program received signal SIGSEGV, Segmentation fault.

Dear all, I used debugger from C++ and these are the message I got: Program received signal SIGSEGV, Segmentation fault. 0x00323fc0 in free () from /lib/tls/libc.so.6 (gdb) info s #0 0x00323fc0 in free () from /lib/tls/libc.so.6 #1 0x00794fa1 in operator delete () from... (5 Replies)
Discussion started by: napapanbkk
5 Replies

4. UNIX for Advanced & Expert Users

Threads terminating when a signal is generated

hi all, i had created 3 threads using pthreads. Each thread does a different job. Now the main problem is when one thread generates a signal (for example SIGFPE, SIGINT) then the process terminates and all other threads do terminate eventually. I want to keep other threads running i.e, i... (0 Replies)
Discussion started by: skyrulz
0 Replies

5. Programming

Reliable management of signal SIGPIPE and SIGTERM

I' m note very expert in the reliable manage of signal... but in my server I must manage SIGPIPE for the socket and SIGTERM... I've wrote this but there is something wrong... Can someone explain me with some example the reliable management of signal?? This is what I've wrote in the server ... (2 Replies)
Discussion started by: italian_boy
2 Replies

6. UNIX for Advanced & Expert Users

need more user signal

Hi In my program I have already used both SIGUSR1 SIGUSR2 user signals. I need another one. How can I do that? Thank you Naama (1 Reply)
Discussion started by: naamabm
1 Replies

7. Programming

add more user-defined signals

Hi Is there a way to add more user-defined signals? I am currently using SIGUSR1 and SIGUSR2 - but I need another one. How can I do that? Thanks! (9 Replies)
Discussion started by: naamabm
9 Replies

8. Programming

Losing signal problem

I'm newbie in UNIX programming, I have a problem with signals. I'm writing multithread program, where threads can die at any moment. When thread dies it generates signal SIGUSR1 to main thread and then thread dies. Main thread gets a signal and waits for thread dead. I wrote program like this: ... (5 Replies)
Discussion started by: DendyGamer
5 Replies

9. Programming

Why do I receive Program received signal SIGABRT, Aborted?

Im using gdb and when a user disconnects from my server I receive a message Program received signal SIGABRT, Aborted. 0x7ffe0304 in ?? () I was hoping someone here might have a explination for this message in gdb (26 Replies)
Discussion started by: Errigour
26 Replies