cvs commit: src/sys/compat/linux linux_misc.c

Alexander Leidinger netchild at FreeBSD.org
Sat Aug 19 15:03:35 UTC 2006


Quoting Robert Watson <rwatson at FreeBSD.org> (Fri, 18 Aug 2006 18:47:12 +0100 (BST)):

> 
> On Thu, 17 Aug 2006, Alexander Leidinger wrote:
> 
> >  - protect td->td_proc->p_pid with the proc lock in linux_getpid
> >    in the amd64 (= non i386) case [1]
> 
> Is this necessary?  In principle, td->td_proc is static for a live thread 
> bound to a process (i.e., in a system call, which the current thread 
> presumable is, as long as td == curthread), p_pid is static for a live process 
> that isn't exiting (so in a system call is not generally exiting).  The native 
> FreeBSD getpid() only acquires the process lock when following p_pptr, since 
> this can change during a system call (i.e., as a result of the parent dying, 
> and the child being re-parented to init(8)).

Now that you tell me this, I have the impression that I have mixed up
p_pid with p_pptr here... I have to have a look at the code again.

Bye,
Alexander.

-- 
      ...and that is how we know the Earth to be banana-shaped.
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the cvs-src mailing list