i couldnt make my program sleep() after using kill(pid,SIGTERM)
what can i do ?
The code i’m using:
kill(PID_of_Process_to_be_killed,SIGTERM);
sleep(5); --> this is not working
sleep(5); --> this is working
the solution for now is:
kill(PID_of_Process_to_be_killed,SIGTERM);
sleep(sleep(5));
but why the first sleep after kill return 0 ?
Your
sleep()call may be terminating early due to receiving a signal. Check the return value. If it’s positive, you might want tosleep()again on that value. From http://www.manpagez.com/man/3/Sleep/: