Next Previous Contents

86. unix_kill

Synopsis

Send a signal to a process

Usage

Integer_Type unix_kill (Integer_Type pid, Integer_Type sig)

Description

This function may be used to send a signal given by the integer sig to the process specified by pid. The function returns zero upon sucess and -1 upon failure setting errno accordingly.

Example

The unix_kill function may be used to determine whether or not a specific process exists:

    define process_exists (pid)
    {
       if (-1 == unix_kill (pid, 0))
         return 0;     % Process does not exist
       return 1;
    }
Notes

The unix_kill function is not available on all systems.

See Also

getpid


Next Previous Contents