From owner-freebsd-current Fri Jul 20 11: 0:15 2001 Delivered-To: freebsd-current@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id B299F37B405 for ; Fri, 20 Jul 2001 11:00:11 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.4/8.11.2) with ESMTP id f6KHxPv51365; Fri, 20 Jul 2001 10:59:25 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3B5854E3.B6D9C86D@elischer.org> Date: Fri, 20 Jul 2001 10:59:29 -0700 (PDT) From: John Baldwin To: Julian Elischer Subject: RE: huh? in Selrecord(): what is this for? Cc: current@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 20-Jul-01 Julian Elischer wrote: > void > selrecord(selector, sip) > struct proc *selector; > struct selinfo *sip; > { > struct proc *p; > pid_t mypid; > > mypid = selector->p_pid; > if (sip->si_pid == mypid) > return; > if (sip->si_pid && (p = pfind(sip->si_pid))) { > > > Why do we look up 'p' when we got it as an argument? > (race condition detection?) Err, we look up p when the selector pid isn't the pid in the selinfo. I.e., when we _didn't_ get p as an argument. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message