DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

_lwp_kill(2)


_lwp_kill -- send a signal to a sibling lightweight process

Synopsis

   #include <sys/types.h>
   #include <sys/lwp.h>
   #include <sys/signal.h>
   

int _lwp_kill(lwpid_t lwpid, int sig);

Parameters


lwpid
LWP ID of the LWP to receive the signal

sig
signal number of the signal to be sent

Description

_lwp_kill sends a signal sig to a sibling lightweight process (LWP) lwpid. _lwp_kill is the LWP analog of kill.

_lwp_kill functions irrespective of whether the LWP identified by lwpid was created with the LWP_DETACHED flag set.

Job control signals sent to individual LWPs affect the process as a whole.

Uncatchable signals cannot be sent to the init process.

_lwp_kill can succeed (in posting the signal) even if the target lwpid has been suspended by _lwp_suspend.

lwpid parameter

lwpid is the LWP ID of the sibling LWP which is to receive the signal. The scope of lwpid is the process with which the sender is associated; signals cannot be sent to a non-sibling LWP, that is, signals cannot be sent to an LWP in another process using _lwp_kill.

sig parameter

sig is the signal number of the signal to be sent, and is either 0 or a value from the list given in signal(5). 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 lwpid.

Return values

_lwp_kill returns zero for success and an error number for failure, as described below.

Errors

If any of the following conditions is detected, _lwp_kill returns the corresponding value:

EINVAL
The sig argument contains an invalid or unsupported signal number. .IP EPERM The sig argument is SIGKILL or SIGSTOP and the target LWP is in process 1 (init).

ESRCH
No LWP can be found in the current process with identity lwpid.

References

kill(2), sigaction(2), signal(2), sigsend(2), thr_kill(3thread)

Notices

Lightweight processes (LWPs) are internal interfaces and are subject to change. Their use should be avoided.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004