9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] waitpid
@ 2006-11-08  1:02 Joel Salomon
  2006-11-08  1:08 ` Joel Salomon
  2006-11-08  1:10 ` Russ Cox
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Salomon @ 2006-11-08  1:02 UTC (permalink / raw)
  To: 9fans

I’m trying to wait for all child processes to finish.  The lunix code my professor gave me for this was:
	while (wait(&wstat)>0)
		;
which I naïvely translated as:
	while(waitpid() != 0)
		;
which hangs.  Evidently waitpid returns something other than 0 when there are no children, but what?  The man page wait(2) doesn’t say, nor does it point to the source for waitpid.

--Joel



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-11-08  6:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-08  1:02 [9fans] waitpid Joel Salomon
2006-11-08  1:08 ` Joel Salomon
2006-11-08  1:13   ` geoff
2006-11-08  1:10 ` Russ Cox
2006-11-08  1:15   ` Joel Salomon
2006-11-08  1:25     ` Joel Salomon
2006-11-08  1:28     ` Bruce Ellis
2006-11-08  2:30       ` Federico Benavento
2006-11-08  6:55         ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).