From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18862 invoked by alias); 16 Apr 2007 14:19:19 -0000 Received: (qmail 18851 invoked by uid 22791); 16 Apr 2007 14:19:17 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Apr 2007 15:19:14 +0100 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id E08794B26F; Mon, 16 Apr 2007 09:19:11 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 961D94B262; Mon, 16 Apr 2007 09:19:04 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HdS2k-00010U-NJ; Mon, 16 Apr 2007 10:18:58 -0400 Date: Mon, 16 Apr 2007 15:14:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: yoriko@sm.sony.co.jp, gdb-patches@sourceware.org Subject: Re: deal thread id as unsigned Message-ID: <20070416141858.GA3844@caradoc.them.org> Mail-Followup-To: Mark Kettenis , yoriko@sm.sony.co.jp, gdb-patches@sourceware.org References: <20070416111505.AE36.YORIKO@sm.sony.co.jp> <200704161410.l3GEARpW030103@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200704161410.l3GEARpW030103@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00250.txt.bz2 On Mon, Apr 16, 2007 at 04:10:27PM +0200, Mark Kettenis wrote: > > Date: Mon, 16 Apr 2007 11:39:55 +0900 > > From: Yoriko Komatsuzaki > > > > Hello. > > > > I would like to ask you to consider this tiny patch about thread id type. > > Thread id is unsigned type in Linux. > > I believe it used to be a signed type in Linux. Anyway, you can't > really change it, since on other OS'es the type defenitely is signed. Well, it used to be an int, but it would never be negative (always small and positive). > You'll only really notice this when the msb is set anyway. I think > this happens on the Linux threads implementation of today the thread > id isn't an integer at all, but a pointer instead. This suggests that > it should really be printed as an (unsigned) hexadecimal number. > Doing so doesn't need any changes to defs.h and therefore wouldn't > affect any other platforms at all. Right. I think printing it as hex is fine even for LinuxThreads, where 0x4000 is not substantially less clear than "16384" (which was always the thread ID of the first thread, no relation to PIDs). -- Daniel Jacobowitz CodeSourcery