killpg(2) DG/UX R4.11MU05 killpg(2)
NAME
killpg - send signal to a process or a process group
SYNOPSIS
int killpg (pgrp, signalnumber)
int pgrp;
int signalnumber;
where:
pgrp Process-group-id of the processes being sent the
signal
signalnumber Type of signal being sent
DESCRIPTION
Killpg sends the signal signalnumber to all processes in the process
group identified by pgrp.
The sending process must have permission to send a signal to the
process group members. The signal is sent to all those processes for
which the caller has permission.
The process group identified by pgrp falls into one of four
categories depending on the value of pgrp:
pgrp > 0 Signal all processes in a specified process group.
Signalnumber will be sent to all processes in the
process group whose process-group-id is equal to pgrp.
System processes are never selected.
pgrp = 0 Signal all processes in the sender's process group.
Signalnumber will be sent to all processes, excluding
system processes, whose process-group-id is equal to the
process-group-id of the sender. It is an error for the
process-group-id of the sender to be zero.
pgrp = -1 Signal all processes.
If the sending process has appropriate privilege,
signalnumber is sent to all processes excluding system
processes. Otherwise, signalnumber is sent to all
processes, excluding system processes, whose process-
group-id is -1 (i.e., no processes will be sent
signalnumber).
For systems supporting the DG/UX Capability Option, appropriate
privilege is defined as having one or more specific capabilities
enabled in the effective capability set of the sending process. See
capdefaults(5) for the default capability for this system call.
On generic DG/UX systems, appropriate privilege means that the
process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
pgrp < -1
Signal all processes in a specified process group.
Signalnumber will be sent to all processes, excluding system
processes, whose process-group-id is equal to pgrp. [This
selects no processes.]
ACCESS CONTROL
Permission to send a signal is granted in three ways:
· The sending and receiving processes have the same effective-
user-id.
· The sending process has appropriate privilege.
· The sending process is an ancestor of the receiving process
and the signal being sent is SIGCONT.
RETURN VALUE
0 Completed successfully.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EINVAL Signalnumber is not a valid signal number.
EINVAL pgrp is zero and the caller's process-group-id is zero.
ESRCH No process can be found in the process group identified by
pgrp.
EPERM The sending process does not have permission to signal all
members of the specified process group. This error code is
not set by the Berkeley implementations.
SEE ALSO
csh(1), kill(1), kill(2), signal(2), jobs(3C).
Licensed material--property of copyright holder(s)