So the following function should be called to kill the parent process. But it leaves the child processes alive. I know you can pass a argument to the sigkill in shell command to kill all the child process under this process group. But how to do this in C?
kill(parent, SIGKILL);