Is the kill function in Linux synchronous? Say, I programatically call the kill function to terminate a process, will it return only when the inten
kill
No, since it doesn't kill anything, it only sends a signal to the process.
By default this signal can even be blocked or ignored.
You can't block kill -9 which represents sending SIGKILL
kill -9
SIGKILL
To wait for the process to die:
while kill -0 PID_OF_THE_PROCESS 2>/dev/null; do sleep 1; done