From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.devel Subject: Re: proced: ppid of process ID 0 can be 0 Date: Sat, 20 Dec 2008 20:41:20 +0100 Message-ID: <18765.19040.568030.246241@tfkp04.physik.uni-erlangen.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1229802104 11656 80.91.229.12 (20 Dec 2008 19:41:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Dec 2008 19:41:44 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 20 20:42:50 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 1LE7ir-0001m5-Lp for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2008 20:42:49 +0100 Original-Received: from localhost ([127.0.0.1]:49920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LE7hf-0006Ll-35 for ged-emacs-devel@m.gmane.org; Sat, 20 Dec 2008 14:41:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LE7hb-0006LS-FT for emacs-devel@gnu.org; Sat, 20 Dec 2008 14:41:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LE7ha-0006LG-QJ for emacs-devel@gnu.org; Sat, 20 Dec 2008 14:41:31 -0500 Original-Received: from [199.232.76.173] (port=52261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LE7ha-0006LD-Nm for emacs-devel@gnu.org; Sat, 20 Dec 2008 14:41:30 -0500 Original-Received: from tfkpsv.physik.uni-erlangen.de ([131.188.164.197]:1857) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LE7hY-0000JS-7n; Sat, 20 Dec 2008 14:41:28 -0500 Original-Received: from tfkp04.physik.uni-erlangen.de (tfkp04.physik.uni-erlangen.de [131.188.164.204]) by tfkpsv.physik.uni-erlangen.de (Postfix) with ESMTP id 6D52E21486; Sat, 20 Dec 2008 20:41:21 +0100 (CET) In-Reply-To: X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 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:107136 Archived-At: On Sat Dec 20 2008 Eli Zaretskii wrote: > > I see two ways of fixing this: either removing the assumption from > > proced.el, or forcing the Windows implementation of > > system_process_attributes to adapt. First is more correct, second is > > much easier (see tiny patch below). > > I'd prefer that proced.el doesn't make such an unportable assumption. I am not sure I get the point here. What is unportable where? I mean, it seems to me that ultimately the solution is always the same: when using the ppid attribute, one needs to make sure that it is different from the corresponding pid. Or could one assign a special meaning to the case that ppid=pid? There is no doubt that proced assumes that ppid is always different from pid. A comparison of ppid and pid can be implemented either on the level of system_process_attributes. (I don't know whether for other operating systems besides Windows we can have similar problems.) Or it can be implemented inside proced. In the latter case, I would implement the comparison of ppid and pid in proced-process-attributes which is kind of the low-level function in Proced calling system-process-attributes. (No other proced function calls system-process-attributes.) So having the comparison of ppid and pid in that function would work for proced for all operating systems (requiring only a very small change in the code). Yet anybody using system-process-attributes elsewhere might be surprised that the return value of system-process-attributes can give such meaningless results so that he/she probably would have to implement the same check. So maybe for a clear definition of the ppid attribute returned by system-process-attributes, we could require that it must be different from pid. Roland