Skip to content
Advertisement

Tag: zombie-process

How to avoid read() from hanging in the following situation?

I have some code that forks a third-party application and redirects its standard output to the parent process, roughly as follows (no error handling here for brevity): I have no code for the third-party application, it is a proprietary binary. When running the third-party application in a terminal with the same arguments as used in the code above, it eventually

read() hangs on zombie process

I have a while loop that reads data from a child process using blocking I/O by redirecting stdout of the child process to the parent process. Normally, as soon as the child process exits, a blocking read() in this case will return since the pipe that is read from is closed by the child process. Now I have a case

Can someone please explain how this works?fork(),sleep()

What is happening here? How is sleep() getting executed in the for loop? When is it getting called? Here is the output: Please explain this output. I am not able to understand how it’s working. Step by step analysis would be great. Answer In the first loop, the original (parent) process forks 10 copies of itself. Each of these child

Linux, waitpid, WNOHANG, child process, zombie

I running my program as daemon. Father process only wait for child process, when it is dead unexpected, fork and wait again. But when child process being killed with -9 signal, the child process goes to zombie process. waitpid should return the pid of child process immediately! But waitpid got the pid number after about 90 seconds, Here is the

Advertisement