[squeak-dev] Re: OSProcess left-over pipe handles?

Andreas Raab andreas.raab at gmx.de
Sat Dec 12 03:17:50 UTC 2009

Gerardo Richarte wrote:
> without going to see anything in squeak (so, maybe totally wrong),
> usually when you call pipe() in unix, you then fork() and pass one of
> the two descriptors to the child process. The common practice is to
> close() the file descriptors passed to the child process. This has to be
> done in the parent process after forking. Otherwise the parent keeps
> open the end of the pipe() corresponding to the child.

Thanks. We're using PipeableOSProcess to be able to get to the output of 
various commands.

> Of course, after finishing you also hahve to close() the other end of
> the pipe() in the parent. The child process usually dies, hence closing
> all file descriptors. But, if the child doesn't die, then you have to be
> careful to also close the file descriptors belonging to the parent, and
> the proper way to do it is to close them just after forking, in the
> child process... something like:

Hm ... not sure what OSProcess does in that regard. Anyone know?

Thanks for the info!

   - Andreas

More information about the Squeak-dev mailing list