Skip to content
BSD syscall#37

svc · unix #37

kill

Sends a signal to a process or process group identified by PID.

Prototype

int kill(int pid, int signum, int posix);

Returns: int

Arguments

NameTypeDirDescription
pidint-
signumint-
posixint-

Version history

XNU tagmacOS#
xnu-1456.1.26macOS 10.6 Snow Leopard37
xnu-1486.2.1137
xnu-1504.15.337
xnu-1504.3.1237
xnu-1504.7.437
xnu-1504.9.1737
xnu-1504.9.2637
xnu-1504.9.3737

Notes

Permission checks compare the sender's effective/real UID against the target's saved-set UID, with root bypassing the check. PID 0 targets the caller's process group, -1 broadcasts to every permitted process, and negative PIDs address an explicit pgid. Sending signal 0 performs only the permission and existence check, which is the standard way to probe whether a PID is alive.

Detection

Endpoint Security exposes ES_EVENT_TYPE_NOTIFY_SIGNAL with sender, target, and signal number. DTrace proc:::signal-send shows args[0]=target proc, args[2]=signal.

Related APIs

sigactionsigprocmasksigsuspend__sigwaitwaitid