lkml.org 
[lkml]   [2004]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fixing UML against NPTL (was: Re: [uml-devel] [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes (take #2))
On Thu, Nov 04, 2004 at 05:31:21AM +0100, Blaisorblade wrote:
> 2) getpid() on a child clone returns the process's pid when run with a
> NPTL-enabled glibc, while it returns the thread pid with a LinuxThreads one;
> this causes tons of problems with UML, which uses signals as inter-thread and
> intra-thread communication.
>
> Note UML is not using pthread_create() to create the threads, where this
> behaviour is an improvement. I'm using a plain clone() call without the
> CLONE_THREAD flag (which is not even added in by glibc, according to strace).
>
> I've not yet checked if glibc is hijacking getpid() or not, but that would be
> strange anyway.

Glibc caches the PID. If you're going to use clone directly, use the
gettid/getpid syscall directly. It's kind of rude that glibc breaks
getpid in this way; I recommend filing a bug in the glibc bugzilla at
sources.redhat.com.

--
Daniel Jacobowitz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.356 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site