Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

KILL

Portability Function: Sends a signal to the process given by ID.

Module

USE IFPORT

result = KILL (pid,signum)

pid

(Input) INTEGER(4). ID of a process to be signaled.

signum

(Input) INTEGER(4). A signal value. For the definition of signal values, see the SIGNALfunction.

Results

The result type is INTEGER(4). The result is zero if the call was successful; otherwise, an error code. Possible error codes are:

  • EINVAL: The signum is not a valid signal number, or PID is not the same as getpid( ) and signum does not equal SIGKILL.

  • ESRCH: The given PID could not be found.

  • EPERM: The current process does not have permission to send a signal to the process given by PID.

On Windows* systems, arbitrary signals can be sent only to the calling process (where pid= getpid( )). Other processes can send only the SIGKILL signal ( signum= 9), and only if the calling process has permission.

Example

USE IFPORT
integer(4) id_number, sig_val, istat
id_number=getpid( )
ISTAT = KILL (id_number, sig_val)