Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2004 14:58:45 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        "Georg-W. Koltermann" <gwk@rahn-koltermann.de>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: how to implement linux_gettid
Message-ID:  <20040719215845.GA12055@dhcp50.pn.xcllnt.net>
In-Reply-To: <1090273635.1511.15.camel@localhost.muc.eu.mscsoftware.com>
References:  <1090273635.1511.15.camel@localhost.muc.eu.mscsoftware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 19, 2004 at 11:47:15PM +0200, Georg-W. Koltermann wrote:
> 
> Could someone explain how our threading works when accessed from Linux,
> and maybe give me a hint how gettid() should be implemented correctly?

It depends. If user threading under linux compatibility is still
implemented using fork(2), then you'll have a process per user thread.
In that case it doesn't matter how threading is natively implemented.

So, if fork(2) is the basis for threading, return td->td_proc->p_pid,
otherwise you probably want to return td->td_tid.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040719215845.GA12055>