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: Wed, 24 Dec 2008 06:14:55 +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> <87wsdqjzar.fsf@kobe.laptop> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1230092135 24101 80.91.229.12 (24 Dec 2008 04:15:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2008 04:15:35 +0000 (UTC) Cc: keramida@ceid.upatras.gr, lekktu@gmail.com, Roland.Winkler@physik.uni-erlangen.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 24 05:16:41 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 1LFLAk-0006Gs-HA for ged-emacs-devel@m.gmane.org; Wed, 24 Dec 2008 05:16:39 +0100 Original-Received: from localhost ([127.0.0.1]:37536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFL9V-0002nT-Nr for ged-emacs-devel@m.gmane.org; Tue, 23 Dec 2008 23:15:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFL9N-0002la-P8 for emacs-devel@gnu.org; Tue, 23 Dec 2008 23:15:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFL9M-0002lC-UD for emacs-devel@gnu.org; Tue, 23 Dec 2008 23:15:13 -0500 Original-Received: from [199.232.76.173] (port=41810 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFL9M-0002l8-P0 for emacs-devel@gnu.org; Tue, 23 Dec 2008 23:15:12 -0500 Original-Received: from mtaout7.012.net.il ([84.95.2.19]:26289) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LFL9M-0001ju-Ad for emacs-devel@gnu.org; Tue, 23 Dec 2008 23:15:12 -0500 Original-Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KCD0060057Q7U00@i-mtaout7.012.net.il> for emacs-devel@gnu.org; Wed, 24 Dec 2008 06:17:28 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.252.83]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KCD006RN59374C0@i-mtaout7.012.net.il>; Wed, 24 Dec 2008 06:17:28 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (1203?) 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:107261 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , lekktu@gmail.com, emacs-devel@gnu.org, Roland.Winkler@physik.uni-erlangen.de > Date: Tue, 23 Dec 2008 21:34:56 -0500 > > >>>> More to the point: even if we could distinguish the "no ppid" from > >>>> "unkown ppid", it's unclear how Elisp code could make use of it. > >>> Lisp code cannot, but a primitive written in C can. > >> > >> Like what can it do? > > > It can differentiate between FreeBSD 4.3 and FreeBSD 7.2 if they use a > > different style of `process root', or between Linux 1.2.X, 2.4.X and > > 2.6.X. Right now, Emacs sets `system-type' to "berkeley-unix" on more > > than one BSD system. They might be easier to detect at C level. > > That's not what I'm asking. I'm asking: what can C code (or Elisp code > for that matter) do when the ppid is somehow not found (i.e. there's no > ppid available, but the process might have a parent). The process-tree-root-p primitive does not need to employ the same logic (nor even the same syscalls, actually) that system-process-attributes does. The latter simply omits from the alist it returns any attribute that it could not fetch for some reason, any reason. The former could do something else. What exactly, I will figure out when I write it.