the best form to wait the finish of execution of a child...

Peter Jeremy PeterJeremy at optushome.com.au
Wed Mar 30 23:37:23 PST 2005


On Wed, 2005-Mar-30 14:17:43 -0400, zean zean wrote:
>Excuse for my badly English.  which is the best form to wait  the
>finish of execution of a child.

That's virtually impossible to answer as a general case.  The best
form depends on exactly what you want to do.

>My idea is:
>
>pid_t chilpid;
>
>while(childpid != wait(&status))
>;


If you want to wait for a specific pid, look at waitpid() or wait4():
	if (waitpid(childpid, &status, 0) == -1) {
		handle error
	}

-- 
Peter Jeremy


More information about the freebsd-hackers mailing list