kill

Sends a signal to the process specified by a process ID.

Format

#include  <signal.h>

int kill  (int pid, int sig);

Arguments

pid
The process ID.
sig
The signal code.

Description

This function sends a signal to a process, as if the process had called raise. If the signal is not trapped or ignored by the target program, the program exits.

OpenVMS VAX and Alpha implement different rules about what process you are allowed to send signals to. A program always has privileges to send a signal to a child started with vfork/exec. For other processes, the results are determined by the OpenVMS security model for your system.

Unless you have system privileges, the sending and receiving processes must have the same user identification code (UIC).

On OpenVMS systems before Version 7.0, kill treats a signal value of 0 as if SIGKILL were specified.

For OpenVMS Version 7.0 and higher systems, if you include <stdlib.h> and compile with the _POSIX_EXIT feature-test macro set, then:

Return Values
Indicates that kill was successfully queued. 
-1  Indicates errors. The receiving process may have a different UIC and you are not a system user, or the receiving process does not exist.  


Previous Page | Next Page | Table of Contents | Index