Why close other end of pipe?

Why a process should close the other end of the pipe that it doesn’t use ?
Back again, hun? Read this post (this will help with your waitpid() question too.

http://www.eecs.harvard.edu/~margo/cs161/videos/fork-exec.pdf
I helped you earlier in the week (Help! Need to design and implement a basic shell). I was talking to you. I'm not Chinese.
Last edited on
Suppose the child reads the pipe but doesn't close the writing end. How will it know when to stop reading? If there is no data to read, the OS will simply block the process until a writer adds something to the pipe, and for all the OS knows, that could be the very same process that's trying to read it.
what do you mean?
Thanks dhayden...sorry for misunderstanding booth
Topic archived. No new replies allowed.