From owner-freebsd-current Sun Apr 2 16:12:49 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 6597037B58F for ; Sun, 2 Apr 2000 16:12:47 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id QAA51299; Sun, 2 Apr 2000 16:12:18 -0700 (PDT) (envelope-from dillon) Date: Sun, 2 Apr 2000 16:12:18 -0700 (PDT) From: Matthew Dillon Message-Id: <200004022312.QAA51299@apollo.backplane.com> To: Alfred Perlstein Cc: current@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/i386 support.s src/sys/kern init_sysent.c kern_prot.c kern_sig.c References: <200004021752.KAA13175@freefall.freebsd.org> <20000402163552.P21029@fw.wintelcom.net> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :Along with snagging the "easy ones" for MP safeness, shouldn't getpid :be MP safe? The struct proc is allocated from the proc_zone, and :afaik zalloc allows for stable storage meaning it's safe to dereference :the ppid pointer once the entire struct proc is populated, which needs :to happen before the process can even call getpid(). : :phk seems to agree. : :-- :-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] :"I have the heart of a child; I keep it in a jar on my desk." The problem is that getpid() also extracts the ppid (look at the syscall code), which is not MP safe. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message