From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: proced: ppid of process ID 0 can be 0 Date: Mon, 22 Dec 2008 21:57:30 +0200 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1229975959 18796 80.91.229.12 (22 Dec 2008 19:59:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Dec 2008 19:59:19 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org, Roland.Winkler@physik.uni-erlangen.de To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 22 21:00:25 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 1LEqwy-000170-L6 for ged-emacs-devel@m.gmane.org; Mon, 22 Dec 2008 21:00:24 +0100 Original-Received: from localhost ([127.0.0.1]:44688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEqvm-0002sK-5C for ged-emacs-devel@m.gmane.org; Mon, 22 Dec 2008 14:59:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LEquD-0001bk-3i for emacs-devel@gnu.org; Mon, 22 Dec 2008 14:57:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LEqu8-0001YD-QY for emacs-devel@gnu.org; Mon, 22 Dec 2008 14:57:29 -0500 Original-Received: from [199.232.76.173] (port=36190 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEqu8-0001Xy-LS for emacs-devel@gnu.org; Mon, 22 Dec 2008 14:57:28 -0500 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:53497) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LEqu7-00053u-RJ for emacs-devel@gnu.org; Mon, 22 Dec 2008 14:57:28 -0500 Original-Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KCA00D00NGE4X00@i_mtaout2.012.net.il> for emacs-devel@gnu.org; Mon, 22 Dec 2008 21:59:55 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.252.83]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KCA00E80NJURZ90@i_mtaout2.012.net.il>; Mon, 22 Dec 2008 21:59:55 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:107197 Archived-At: > From: Stefan Monnier > Cc: Roland.Winkler@physik.uni-erlangen.de, lekktu@gmail.com, emacs-devel@gnu.org > Date: Mon, 22 Dec 2008 07:23:05 -0500 > > To me the definition of "root" is "has no parent", so the two are > equivalent. Same here. But "having no parent" and "found zero in /proc/NNN/stat" is not necessarily the same. > I could live with a predicate process-tree-root-p, but I'd expect it > to just check for the absence of a parent. Me too. However, that check is OS-dependent, so I don't think it should be in Lisp. > > It is also more reliable, since ppid attribute could be missing for > > some other reason, like failure to access the attribute. > > And what would your process-tree-root-p say in that case? It depends on the OS. > On my GNU/Linux system, 0 is not a process, so a ppid of 0 is not > a parent but rather the mark of the absence of a parent. Sounds like this isn't true on FreeBSD as well, not only on MS-Windows.