From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 25 10:29:59 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A26D616A41A; Thu, 25 Oct 2007 10:29:59 +0000 (UTC) (envelope-from marc.loerner@hob.de) Received: from mailgate.hob.de (mailgate.hob.de [212.185.199.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5532E13C48A; Thu, 25 Oct 2007 10:29:59 +0000 (UTC) (envelope-from marc.loerner@hob.de) Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgate.hob.de (Postfix) with ESMTP id 9D7BF280FA; Thu, 25 Oct 2007 11:59:41 +0200 (CEST) Received: from mailgate.hob.de ([127.0.0.1]) by localhost (mailgate.hob.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32008-02; Thu, 25 Oct 2007 11:59:41 +0200 (CEST) Received: from imap.hob.de (mail2.hob.de [172.25.1.102]) by mailgate.hob.de (Postfix) with ESMTP id 2E1A8280EA; Thu, 25 Oct 2007 11:59:41 +0200 (CEST) Received: from [172.22.0.190] (linux03.hob.de [172.22.0.190]) by imap.hob.de (Postfix on SuSE eMail Server 2.0) with ESMTP id B26A0C6782; Thu, 25 Oct 2007 11:59:40 +0200 (CEST) From: Marc =?utf-8?q?L=C3=B6rner?= Organization: hob To: freebsd-hackers@freebsd.org Date: Thu, 25 Oct 2007 12:01:21 +0200 User-Agent: KMail/1.6.2 References: <47205B91.80408@FreeBSD.org> In-Reply-To: <47205B91.80408@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200710251201.21900.marc.loerner@hob.de> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at hob.de Cc: Sergey Matveychuk Subject: Re: How to get a kthread ID? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2007 10:29:59 -0000 On Thursday 25 October 2007 11:02, Sergey Matveychuk wrote: > Is there a possibility to get a kthread ID inside a kthread? > Just like pthread_self(3). In function kthread_exit there you see that you can obtain the thread-structure with curthread. And then in this thread-structure is the field td_tid. HTH, Marc