svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
kill(2)
kill(2) System Calls kill(2)
NAME
kill - send a signal to a process or a group of processes
SYNOPSIS
#include <sys/types.h>
#include <signal.h>
int kill(pid_t pid, int sig);
DESCRIPTION
The kill() function sends a signal to a process or a group of
processes. The process or group of processes to which the signal is to
be sent is specified by pid. The signal that is to be sent is specified
by sig and should be one of the values defined in signal.h(3HEAD), 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 pid.
The real or effective user ID of the sending process must match the
real or saved (from one of functions in the exec(2) family) user ID of
the receiving process, unless the privilege {PRIV_PROC_OWNER} is as‐
serted in the effective set of the sending process (see Intro(2)), or
sig is SIGCONT and the sending process has the same session ID as the
receiving process. A process needs the basic privilege {PRIV_PROC_SES‐
SION} to send signals to a process with a different session ID. See
privileges(7).
If pid is greater than 0, sig will be sent to the process whose process
ID is equal to pid.
If pid is negative but not (pid_t)−1, sig will be sent to all processes
whose process group ID is equal to the absolute value of pid and for
which the process has permission to send a signal.
If pid is 0, sig will be sent to all processes excluding special
processes (see Intro(2)) whose process group ID is equal to the process
group ID of the sender.
If pid is (pid_t)−1 and the {PRIV_PROC_OWNER} privilege is not asserted
in the effective set of the sending process, sig will be sent to all
processes excluding special processes whose real user ID is equal to
the effective user ID of the sender.
If pid is (pid_t)−1 and the {PRIV_PROC_OWNER} privilege is asserted in
the effective set of the sending process, sig will be sent to all
processes excluding special processes.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, −1 is returned,
no signal is sent, and errno is set to indicate the error.
ERRORS
The kill() function will fail if:
EINVAL The sig argument is not a valid signal number.
EPERM The calling process does not have permission to send the sig‐
nal to any of the processes specified by pid. If at least one
process could be signalled, the call is considered successful
and no error is reported.
The effective user of the calling process does not match the
real or saved user and the calling process does not have the
{PRIV_PROC_OWNER} privilege asserted in the effective set,
and the calling process either is not sending SIGCONT to a
process that shares the same session ID or does not have the
{PRIV_PROC_SESSION} privilege asserted and is trying to send
a signal to a process with a different session ID.
ESRCH No process or process group can be found corresponding to
that specified by pid.
USAGE
The sigsend(2) function provides a more versatile way to send signals
to processes.
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelAsync-Signal-
Safe _ StandardSee standards(7).
SEE ALSO
kill(1), exec(2), getpid(2), getsid(2), Intro(2), setpgrp(2), sigac‐
tion(2), sigsend(2), signal(3C), signal.h(3HEAD), attributes(7), privi‐
leges(7), standards(7)
HISTORY
The kill() function has been included in all Sun and Oracle releases of
Solaris.
Oracle Solaris 11.4 30 Jan 2023 kill(2)