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(2) BSD System Calls Manual PTHREAD_KILL(2)NAME
pthread_kill -- send a signal to a specified thread
SYNOPSIS
#include <signal.h>
int
pthread_kill(pthread_t thread, int sig);
DESCRIPTION
The pthread_kill() function sends a signal, specified by sig, to a thread, specified by thread. If sig is 0, error checking is performed,
but no signal is actually sent.
RETURN VALUES
If successful, pthread_kill() returns 0. Otherwise, an error number is returned.
ERRORS
The pthread_kill() function will fail if:
[ESRCH] thread is an invalid thread ID.
[EINVAL] sig is an invalid or unsupported signal number.
[ENOTSUP] thread was not created by pthread_create() and does not support being killed with pthread_kill()
LEGACY SYNOPSIS
#include <pthread.h>
#include <signal.h>
The include file <pthread.h> is necessary.
SEE ALSO kill(2), pthread_self(3), raise(3), compat(5)STANDARDS
pthread_kill() conforms to ISO/IEC 9945-1:1996 (``POSIX.1'')
BSD Feb 05, 2002 BSD
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)
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)
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)
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)
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)
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)
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)
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)