Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

kill(2) OSS System Calls Reference Manual
NAME
kill - Sends a signal to a process or group of processes
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <signal.h>
int kill(
pid_t pid,
int signal);
PARAMETERS
pid Specifies the process or group of processes to be sent a signal.
signal Specifies the signal. If the signal parameter has the value 0 (zero, the null sig-
nal), error checking is performed but no signal is sent. The null signal can be
used to check the validity of the pid parameter.
DESCRIPTION
The kill() function sends the signal specified by the signal parameter to the process or group of
processes specified by the pid parameter.
To send a signal to another process, at least one of the following must be true:
The real or effective user ID of the sending process must match the real or saved-set-user
ID of the receiving process.
The process is trying to send the SIGCONT signal to a process in the same session.
The calling process has appropriate privileges.
Processes can send signals to themselves.
Use on Guardian Objects
The kill() function cannot send signals to Guardian processes.
Use From the Guardian Environment
If called from a Guardian process, the actions of this function are undefined and errno is set to
[ENOTOSS].
Specifying the Target Process
The kill() function allows the calling process to send a signal to a specific group of processes.
The pid parameter specifies the group according to the following rules:
If the pid parameter is greater than 0 (zero), the signal specified by the signal parameter
is sent to the process that has an OSS process ID (PID) equal to the value of the pid
parameter.
If the pid parameter is equal to 0 (zero), the signal specified by the signal parameter is
sent to all of the processes whose process group ID is equal to the process group ID of
the sender and for which the process has permission to send the signal.
If the pid parameter is negative but not equal to -1, the signal specified by the signal
parameter is sent to all of the processes whose process group ID is equal to the absolute
value of the pid parameter and for which the process has permission to send the signal.
42 Hewlett-Packard Company 527186-023