System V use of wait(2)

Andy Greener andy at istbt.UUCP
Tue Mar 19 21:35:24 AEST 1985


Jack Jansen, ({decvax|philabs|seismo}!mcvax!jack) writes:
> 
> Well, for the benefit of all V7 users that are still out there:
> There is a bug like this in Version 7 tar.
> When it has to make a new directory, it does something like
> 
> 	if( fork() == 0) {
> 		exec("/bin/mkdir",....)
> 		exit();
> 	}
> 	while( wait(NULL) > 0 );	<--- GRRRRR
> 
> Now, guess what happens when you start up tar in the receiving
> end of a pipe.......
> 
> (For those who don't like guessing: The shell sets up pipes so
> that the front end is a child of the back end. This means that,
> besides the mkdir, tar will have another child, being the first
> end of the pipe. This means that the second wait will take a
> *very* long time........)

V7? This bug is still there in Sys V.2!!! (I made reference to it in
my original article about the pg shell-out problem - we fixed tar to
work correctly here).

There must be others lurking out there somewhere.

			Andy Greener	Imperial Software Technology
					London
					{mcvax,qtlon,inset,root44}!ist!andy



More information about the Comp.unix.wizards mailing list