* Matthew Dillon <[EMAIL PROTECTED]> [000402 16:37] wrote:
> 
> :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 - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
> :"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.

I did look at the code, struct proc is allocated from a zone,
meaning it won't "go away" once allocated, there's no danger in
dereferencing p_pptr, I don't get it.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to