_lwp_kill.2 (2010 09)
_
_lwp_kill(2) _lwp_kill(2)
NAME
_lwp_kill() - send a signal to an LWP (Lightweight Process)
SYNOPSIS
cc [ flag... ] file... -lpthread
#include <signal.h>
#include <sys/lwp_signal.h>
int _lwp_kill(lwpid_t target_lwp, int sig);
DESCRIPTION
The _lwp_kill() function sends a signal to the LWP target_lwp . The target_lwp can be in any pro-
cess.
_lwp_kill() is the LWP equivalent of kill().
The signal to be sent is specified by sig and is either one from the list given in signal(5), or 0. 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 the LWP target_lwp.
If the LWP target_lwp is in another process, the real or effective user ID of the sending process must
match the real or saved user ID of the receiving process unless the effective user ID of the sending process
is a user who has appropriate privileges.
If the signal action for sig specifies termination, stop or continue, the entire process is terminated,
stopped or continued, respectively.
Uncatchable signals (for example, SIGKILL and SIGSTOP) cannot be sent to an LWP in the init process.
Signals cannot be sent to kernel daemon threads and helper threads created internally by the HP-UX sys-
tem.
RETURN VALUE
Upon successful completion, _lwp_kill() returns with a value of 0; otherwise, it returns an error
number to indicate the error. The errno variable is NOT set if an error occurs.
ERRORS
If any of the following conditions occur, the
_lwp_kill() function fails and returns the corresponding
error number:
[EINVAL]
sig is neither a valid signal number nor zero.
[EINVAL]
sig is SIGKILL or SIGSTOP and target_lwp is an LWP in the process with pid
1 (proc1).
[EPERM]
The caller does not have the necessary privileges.
[ESRCH]
No LWP can be found with the identity target_lwp .
WARNINGS
In general, the POSIX pthread interfaces should be used by multi-threaded applications. This system call
may be used directly only when the application has a need to operate on LWPs in another process. This
system call may result in undefined behavior if the usage is mixed with POSIX pthread APIs.
SEE ALSO
kill(1), _lwp_self(2), kill(2), sigaction(2), pthread_kill(3T), signal(5).
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1