This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calls to getpid() in clone'd child return parent's pid.


On Thu, Sep 14, 2006 at 12:02:50AM -0400, Carlos O'Donell wrote:
> On 9/13/06, Daniel Jacobowitz <drow@false.org> wrote:
> >Failure to handle RESET_PID in your clone.S, maybe?
> 
> That is correct, we are not handling RESET_PID at all.
> After reading a couple of implementations it looks like we
> need to do the following:
> 
> #ifdef RESET_PID
> - In the cloned child, before calling the clones function.
> - Skip this if CLONE_THREAD or CLONE_VM
> - Call the getpid syscall, and store the result in PID and TID 
> (tcb-offsets.h).
> #endif
> 
> Does that look right?

I've got no idea any more :-)  But not quite - I distinctly remember
some CLONE_VM handling.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]