From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [autotest] vm creation fails (not) Date: Wed, 05 Aug 2009 19:02:49 +0300 Message-ID: <4A79AD29.40407@redhat.com> References: <137563426.1515521249487326121.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Gerd Hoffmann , KVM list To: Michael Goldish Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39325 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933802AbZHEP5U (ORCPT ); Wed, 5 Aug 2009 11:57:20 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n75FvLb6008072 for ; Wed, 5 Aug 2009 11:57:21 -0400 In-Reply-To: <137563426.1515521249487326121.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/05/2009 06:48 PM, Michael Goldish wrote: > > >> You should use wait() to find out if the process is alive, not tricks >> with the PID and process name, which are racy as you found out. >> > > I'm not sure I can do that because the process I'm interested in isn't a > child of mine. > It should be somebody's child and that somebody should wait for it. > In any case, I'd still need to use the process name to make sure the PID > belongs to the original process, because PIDs are reused after a while. > waitpid() solves that problem without using the process name. This isn't a new problem, you should use the established solutions. -- error compiling committee.c: too many arguments to function