1.

Explain the kill() system call and its return values?

Answer»

kill() system call sends signals to any process which further takes suitable action ACCORDING to the signal. It takes two arguments, first is PID, to which you WANT to send a signal and the signal you want to send is second. This method returns the following return values:

  • 0 - means that the process exists with the GIVEN PID and the system allows sending signals to it.
  • -1 and errno==ESRCH - means that the process/process group with SPECIFIED PID does not exist
  • -1 and errno==EPERM - means that the sender has no PERMISSION to send a signal to the target process.
  • EINVAL - means an invalid signal was specified.


Discussion

No Comment Found