Date: Thu, 31 Mar 2005 17:37:20 +1000 From: Peter Jeremy <PeterJeremy@optushome.com.au> To: zean zean <fbsd.hackers@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: the best form to wait the finish of execution of a child... Message-ID: <20050331073720.GE71384@cirb503493.alcatel.com.au> In-Reply-To: <a9e342b5050330101771e53d6f@mail.gmail.com> References: <a9e342b5050330101771e53d6f@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050331073720.GE71384>