HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

k
kill(2) kill(2)
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of
-1 is returned and errno is
set to indicate the error.
ERRORS
If
kill() fails, no signal is sent.
errno is set to one of the following values.
[EINVAL] sig is neither a valid signal number nor zero.
[EINVAL] sig is
SIGKILL or SIGSTOP and pid is that of the initialization process (also known
as
init).
[EPERM] The user ID of the sending process is not a user who has appropriate privileges and its
real or effective user ID does not match the real or saved user ID of the receiving pro-
cess.
[EPERM] The sending and receiving processes are not in the same session and the real or
effective user ID does not match the real or saved user ID of the receiving process.
[ESRCH] No process or process group can be found corresponding to that specified by pid.
If
raise() fails, no signal is sent. errno is set to the following value.
[EINVAL] sig is neither a valid signal number nor zero.
APPLICATION USAGE
Threads Considerations
kill() can be used to post signals to another process but cannot be used to post signals to a specific
thread in another process. For information on posting signals to specific threads within the same process,
see pthread_kill(3T).
LWP (Lightweight Processes) Considerations
Signals cannot be posted to specific LWPs in another process.
AUTHOR
kill() was developed by HP, AT&T, and the University of California, Berkeley.
SEE ALSO
kill(1), getpid(2), setsid(2), signal(2), sigqueue(2), pthread_kill(3T).
STANDARDS CONFORMANCE
kill(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
raise(): AES, SVID3, XPG4, ANSI C
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 171