Fortran Library Reference

kill: Send a Signal to a Process

The function is called by:

status = kill( pid, signum )

pid

INTEGER*4

Input 

Process ID of one of the user's processes  

signum

INTEGER*4

Input 

Valid signal number. See signal(3).

Return value 

INTEGER*4

Output 

status=0: OK

status>0: Error code

Example (fragment): Send a message using kill():


    INTEGER*4 kill, pid, signum 
*    ... 
    status = kill( pid, signum ) 
    if ( status .ne. 0 ) stop 'kill: error' 
    write(*,*) 'Sent signal ', signum, ' to process ', pid 
    end 

The function sends signal signum, and integer signal number, to the process pid. Valid signal numbers are listed in the C include file /usr/include/sys/signal.h

See also: kill(2), signal(3), signal(3F), fork(3F), and perror(3F).