Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ kill.bsd(2) — Domain/IX SR9.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getpid(2)

getpgrp(2)

killpg(2)

sigvec(2)

KILL(2)

NAME

kill − send signal to a process

USAGE

kill(pid, sig) int pid, sig;

DESCRIPTION

Kill sends signal sig to the process identified by the process number pid. Sig may be one of the signals specified in sigvec(2), or it may be zero, in which case error checking (e.g., to see if the process specified by pid exists) is performed but no signal is actually sent. 

Both the sending and receiving processes must have the same effective user ID.  The only exception is the signal SIGCONT, which kill can always send to any child or grandchild of the current process.  In all other cases, the use of kill is restricted to the super-user. 

If the process number is zero, sig is sent to all other processes in the sender’s process group; this is a variant of killpg(2). 

If the process number is -1 and the user is the super-user the signal is sent to all processes running on the machine, with the exception of system processes and the process sending the signal. 

Processes may send signals to themselves. 

RETURN VALUE

A successful call returns zero.  A failed call returns -1 and sets errno as indicated below. 

ERRORS

Kill will fail and no signal will be sent in the following instances:

[EINVAL] Sig is not a valid signal number. 

[ESRCH] No process can be found with the specified pid. 

[EPERM] The sending process is not the super-user and its effective user ID does not match the effective user-ID of the receiving process. 

RELATED INFORMATION

getpid(2), getpgrp(2), killpg(2), sigvec(2)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026