To transform the child process into a zombie you just have it call exit(), and have the parent not pay attention to the SIGCHLD signal as pankaj99 said.
I use waitpid(-1, NULL, WNOHANG); in the parent process to clean up any zombie children, since in the program that uses it I don't care when or why the child exited.
|