This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: Calls to getpid() in clone'd child return parent's pid.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Daniel Jacobowitz" <drow at false dot org>
- Cc: libc-ports at sourceware dot org
- Date: Thu, 14 Sep 2006 00:02:50 -0400
- Subject: Re: Calls to getpid() in clone'd child return parent's pid.
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=iMLTdM0XrtnGL6xTpz187Bc89wphr1aVumzGlRSoQ4ydI6yp7zWnRD+w5FsL29u2PHoxhUCl1MY5cfUN3rUziKmCQsUUnmpMl0lGVTZDMOVXyhlk72ilJYQTsna5dAVhrnfH3yYlHmzOs3CebPy6ww4/5BF517USOQNRqi0Z4ns=
- References: <119aab440609131910g2237f51frdd94774f03e1466@mail.gmail.com> <20060914030059.GA31135@nevyn.them.org>
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?
Cheers,
Carlos.