contents   index   previous   next



Unix.kill()

syntax:

Unix.kill(pid, signal)

where:

pid - process to kill.

 

signal - the signal to send the process.

 

return:

number - 0 for success, -1 for error.

 

description:

This is simply a direct wrapper for the Unix kill command. To get documentation on it for your particular Unix system, just type 'man 2 kill'

 

see:

Unix.fork()

 

example:

// Typically you would use this to kill a child,

// for instance:

 

if( var id = Unix.fork() )

{

   while(1)

      Clib.printf("I am an annoying child.\n");

}

else

{

      // child would be too annoying, so kill it

   Unix.kill(id,9);       //9 is SIGKILL

   Unix.wait(var status); //wait until child is dead

   Clib.printf(

      "I hope DSS doesn't here about this...\n");

}

 


Unix.setgid()