From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: proced: ppid of process ID 0 can be 0 Date: Tue, 30 Dec 2008 12:11:15 -0500 Message-ID: References: <18765.19040.568030.246241@tfkp04.physik.uni-erlangen.de> <18765.29820.997276.703222@tfkp04.physik.uni-erlangen.de> <18765.51840.943986.608296@tfkp04.physik.uni-erlangen.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230657107 3865 80.91.229.12 (30 Dec 2008 17:11:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2008 17:11:47 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org, Roland.Winkler@physik.uni-erlangen.de To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 30 18:12:53 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LHi93-00061o-FW for ged-emacs-devel@m.gmane.org; Tue, 30 Dec 2008 18:12:41 +0100 Original-Received: from localhost ([127.0.0.1]:58657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHi7p-0002Of-P8 for ged-emacs-devel@m.gmane.org; Tue, 30 Dec 2008 12:11:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHi7l-0002OY-N5 for emacs-devel@gnu.org; Tue, 30 Dec 2008 12:11:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHi7j-0002OH-CY for emacs-devel@gnu.org; Tue, 30 Dec 2008 12:11:21 -0500 Original-Received: from [199.232.76.173] (port=49637 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHi7j-0002OE-9I for emacs-devel@gnu.org; Tue, 30 Dec 2008 12:11:19 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:49678 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHi7h-0006aV-M2; Tue, 30 Dec 2008 12:11:17 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYEADnlWUlLd+aG/2dsb2JhbACBbMxChkSBZw X-IronPort-AV: E=Sophos;i="4.36,303,1228107600"; d="scan'208";a="31612018" Original-Received: from 75-119-230-134.dsl.teksavvy.com (HELO pastel.home) ([75.119.230.134]) by ironport2-out.teksavvy.com with ESMTP; 30 Dec 2008 12:11:16 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id F1CB58CF4; Tue, 30 Dec 2008 12:11:15 -0500 (EST) In-Reply-To: (Eli Zaretskii's message of "Wed, 24 Dec 2008 23:12:56 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107412 Archived-At: >> >> > Processes that disappeared while Emacs was reading /proc, for example. >> >> Then don't return them at all >> > How? I don't know enough about Linux kernel internals to decide which >> > attribute's absence means that the process died while Emacs was >> > reading /proc. >> >> AFAIK we're talking about ppid, and this info is always present, so if >> it's absent, don't return the process. > Can you find any authoritative reference that says we can rely on > this? I couldn't even find a decent documentation of /proc when I was > working on these primitives, let alone some information about what > attributes are always present or how that changes with the kernel > version. The ppid is in the /proc/NNN/stat file, those attributes are distinguished by their order, so if it's missing the ordering gets messed up, so it can't be missing. As for the /proc/NNN/stat file missing, that would mean that pretty much all the attributes returned by `ps' would be missing, so we can definitely count on its presence. Stefan