From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 30 18:25:59 2005 Return-Path: <owner-freebsd-hackers@FreeBSD.ORG> Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 513FC16A4CE for <freebsd-hackers@freebsd.org>; Wed, 30 Mar 2005 18:25:59 +0000 (GMT) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CCD543D45 for <freebsd-hackers@freebsd.org>; Wed, 30 Mar 2005 18:25:59 +0000 (GMT) (envelope-from ringworm01@gmail.com) Received: from ringworm.mechee.com ([4.27.46.32])0.04 <0IE6007Q7GJANQY0@vms048.mailsrvcs.net> for freebsd-hackers@freebsd.org; Wed, 30 Mar 2005 12:25:58 -0600 (CST) Received: by ringworm.mechee.com (Postfix, from userid 1001) id F09132CE76A; Wed, 30 Mar 2005 10:25:57 -0800 (PST) Date: Wed, 30 Mar 2005 10:25:57 -0800 From: "Michael C. Shultz" <ringworm01@gmail.com> In-reply-to: <a9e342b5050330101771e53d6f@mail.gmail.com> To: freebsd-hackers@freebsd.org Message-id: <200503301025.57363.ringworm01@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Content-disposition: inline References: <a9e342b5050330101771e53d6f@mail.gmail.com> User-Agent: KMail/1.8 Subject: Re: the best form to wait the finish of execution of a child... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD <freebsd-hackers.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, <mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers> List-Post: <mailto:freebsd-hackers@freebsd.org> List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, <mailto:freebsd-hackers-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 30 Mar 2005 18:25:59 -0000 On Wednesday 30 March 2005 10:17 am, zean zean wrote: > Hi Hackers: > > Excuse for my badly English. which is the best form to wait the > finish of execution of a child. > > My idea is: > > pid_t chilpid; > > while(childpid != wait(&status)) > ; > > Any aid to obtain the best way is very welcome. > > PD. Excuse my ignorance and I hope they can guide me. > > Bye and thanxs ;) > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" Here is how I do it, likely someone will have a better way: pid_t pid; pid = fork(); if( !pid ) { execl( "/bin/mkdir", "mkdir", "directory_name", 0 ); } wait( (int*)pid ); -Mike