normal processes can't avoid to get scheduled out, and as unix programs work without that capability this is not needed and would indeed be dangerous. but why do you want to do that? if you don't want the child process to run because it could exit and defeat the purpose of the kill(), that doesn't work with SMP anyway: the child could be running on another CPU.
if you just want to make sure the pid still refers to a child and not to another process: if you don't ignore SIGCHLD, the child will survive in half-dead state (as a zombie process) to reserve the pid until the parent process got the pid returned from wait(). if you didn't, your kill() will always hit your child, as intended, it just may me dead anyway.
why?
normal processes can't avoid to get scheduled out, and as unix programs work without that capability this is not needed and would indeed be dangerous. but why do you want to do that? if you don't want the child process to run because it could exit and defeat the purpose of the kill(), that doesn't work with SMP anyway: the child could be running on another CPU.
if you just want to make sure the pid still refers to a child and not to another process: if you don't ignore SIGCHLD, the child will survive in half-dead state (as a zombie process) to reserve the pid until the parent process got the pid returned from wait(). if you didn't, your kill() will always hit your child, as intended, it just may me dead anyway.