kill(2)
_________________________________________________________________
kill System Call
Send a signal to a process or a group of processes.
_________________________________________________________________
SYNTAX
None.
int kill (pid, signal_number)
int pid;
int signal_number;
PARAMETERS
pid Id of the process being sent the signal.
signal_number Type of signal being sent.
DESCRIPTION
Kill sends a signal to a process or a group of processes
identified by <pid>. The signal specified by <signal_number> may
be any valid signal or the null signal, SIGNULL. If
<signal_number> is SIGNULL, error checking is performed but no
signal is actually sent. This can be used to check the validity
of sending a valid signal to the processes identified by <pid>.
The processes identified by <pid> fall into four categories
depending on the value of <pid>:
* pid > 0: Signal_a_specified_process.
<Signal_number> will be sent to the process whose process-id is
equal to <pid> if the sender has permission to do so. <pid> may
identify some system processes.
* pid = 0:
Signal_all_processes_in_the_sender's_process_group.
<Signal_number> will be sent to all processes, excluding system
processes, whose process-group-id is equal to the process-group-
id of the sender and to which the sender has permission to
signal.
* pid == -1: Signal_all_processes.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
kill(2)
If the effective-user-id of the sender is super-user,
<signal_number> will be sent to all processes excluding system
processes.
Otherwise, <signal_number> will be sent to all processes,
excluding system processes, whose real-user-id is equal to the
effective-user-id of the sender. [The sender is implicitly
granted permission.]
* pid < -1:
Signal_all_processes_in_a_specified_process_group.
<Signal_number> will be sent to all processes, except system
processes, whose process-group-id is equal to the absolute value
of <pid> and to which the sender has permission to signal.
If an error occurs, no signal will be sent.
ACCESS CONTROL
In order to send a signal to a process, the real- or effective-
user-id of the sending process must match the real- or
effective-user-id of the receiving process (four possibilities),
unless the effective-user-id of the sending process is super-
user.
In addition, the signal SIGKILL may not be sent to a system
process.
RETURN VALUE
0 Completed successfully.
-1 An error occurred. Errno is set to indicate the
error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EINVAL <Signal_number> is neither a valid signal number
nor the null signal.
EINVAL The sending process does not have permission to
send the SIGKILL signal to a system process. This
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
kill(2)
is to change to EPERM in future directions section
of SVID.
ESRCH No process can be found corresponding to that
specified by <pid>.
EPERM The sending process does not have permission to
signal any receiving process.
SEE ALSO
The related system calls: getpid, setpgrp, signal.
The related manual section: kill(1) in the User's Reference for
the DG/UX System
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)