From owner-freebsd-questions@FreeBSD.ORG Wed Nov 30 15:31:32 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5778616A420 for ; Wed, 30 Nov 2005 15:31:32 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id E6E1643D45 for ; Wed, 30 Nov 2005 15:31:31 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 0ED975F38; Wed, 30 Nov 2005 10:31:31 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21583-07; Wed, 30 Nov 2005 10:31:28 -0500 (EST) Received: from [192.168.1.3] (pool-68-161-122-227.ny325.east.verizon.net [68.161.122.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 3B0AE5CCA; Wed, 30 Nov 2005 10:31:28 -0500 (EST) Message-ID: <438DC5D4.80700@mac.com> Date: Wed, 30 Nov 2005 10:31:32 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Javier Matos References: <001601c5f5c2$a77a0720$0301a8c0@mindcrash> In-Reply-To: <001601c5f5c2$a77a0720$0301a8c0@mindcrash> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-questions@freebsd.org Subject: Re: is child PID always minor to parent PID? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2005 15:31:32 -0000 Javier Matos wrote: > Hi, I need to know if the PID of a child process is always higher to > parent PID because I made an algorithm to search a child and I want to > know if I can start searching for a process that have a higher number > than parent PID. No, the PID of a child could be less than the parent if randomize PIDs sysctl is set, or if the PID counter wraps. The fork() call returns the child's pid. Pay attention to that... -- -Chuck