I want use kill() to kill a program. does linux kernel ensure that the program is killed before kill() returned? If not, I have to check whether the program is killed already.
Advertisement
Answer
does linux kernel ensure that the program is killed before kill() returned?
No, kill
merely sends a signal to a process or group of processes. Its successful return only tells you that the signal was sent.
The Linux man pages are straightforward about this, clarifying that a successful return means “at least one signal was sent”.
So, this does not tell you whether the signal is blocked/held pending by the target process, was ignored (SIG_IGN), has taken its default action, has been handled, or accepted.