Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762869AbXKUBoN (ORCPT ); Tue, 20 Nov 2007 20:44:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758203AbXKUBny (ORCPT ); Tue, 20 Nov 2007 20:43:54 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:51756 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755544AbXKUBnx (ORCPT ); Tue, 20 Nov 2007 20:43:53 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Robert Hancock Cc: Ulrich Drepper , Roland McGrath , Guillaume Chazarain , Ingo Molnar , Pavel Emelyanov , "Rafael J. Wysocki" , Pavel Machek , kernel list , netdev Subject: Re: 2.6.24-rc3: find complains about /proc/net References: <47438820.5010300@shaw.ca> Date: Tue, 20 Nov 2007 18:41:56 -0700 In-Reply-To: <47438820.5010300@shaw.ca> (Robert Hancock's message of "Tue, 20 Nov 2007 19:21:36 -0600") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 32 Robert Hancock writes: > Eric W. Biederman wrote: >> Could you elaborate a bit on how the semantics of returning the >> wrong information are more useful? >> >> In particular if a thread does the logical equivalent of: >> grep Pid: /proc/self/status. It always get the tgid despite >> having a different process id. > > The POSIX-defined userspace concept of a PID requires that all threads appear to > have the same PID. This is something that Linux didn't comply with under the old > LinuxThreads implementation and was finally fixed with NPTL. This isn't a > POSIX-defined interface, but I assume it's trying to be consistent with > getpid(), etc. Linux exports two fields in /proc/self/status: Tgid: 32698 Pid: 32698 The tgid maps to the posix concept. The pid is this context is the thread id. So it seems broken to me to return the same thread id for different threads. Eric - 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/