kill

Causes the specified signal to be send to a process.

Library:LibC
Classification:ANSI
Service:Signal Services

Syntax

  #include <signal.h> 
   
  int kill (
     pid_t   pid,
     int     sig );
  

Parameters

pid

(IN) Specifies the process. The value must be greater than 0 and specify an actual process.

sig

(IN) Specifies to the signal to send. For a list of supported signals, see Section 5.1, Standard Signals. If sig is null, error checking is performed, but no signal is sent. This can be used to check the validity of the pid parameter.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno to indicate the error:

Decimal

Constant

Description

9

EINVAL

The value of the sig parameter is invalid or unsupported.

69

EPERM

The process does not have permission to send the signal to the receiving process.

77

ESRCH

No process can be found that matches the pid argument.

105

ENOCONTEXT

No thread context is present.

See Also