all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
Cc: lekktu@gmail.com, emacs-devel@gnu.org
Subject: Re: proced: ppid of process ID 0 can be 0
Date: Sun, 21 Dec 2008 21:17:26 +0200	[thread overview]
Message-ID: <u3aghe3sp.fsf@gnu.org> (raw)
In-Reply-To: <18765.51840.943986.608296@tfkp04.physik.uni-erlangen.de>

> Date: Sun, 21 Dec 2008 05:48:00 +0100
> From: "Roland Winkler" <Roland.Winkler@physik.uni-erlangen.de>
> Cc: lekktu@gmail.com, emacs-devel@gnu.org
> 
> On Sun Dec 21 2008 Eli Zaretskii wrote:
> > Yes, but nobody said that looking at ppid you will have a proper
> > tree.
> 
> Under GNU/linux, the procps package contains not only the ps
> command. But it also contains the command pstree.

I don't see pstree in procps-3.2.7, perhaps I'm missing something.

> Though I didn't look at pstree's source code, I guess it is doing
> its job by analyzing ppid's.

I have no doubt that on GNU/Linux, a ppid of zero is a sign of the
root of the process tree.  But I wrote the 2 primitives that proced.el
uses in order to free proced.el of any such OS-dependent assumptions.
I have no problems with providing another one.

> Somehow I am missing the point here. Why do you think it is
> necessary or advantageous to have a separate primitive for that?

Because the implementation of such a predicate is inherently
OS-dependent, and I don't think proced.el (or any other Lisp program)
should know about how different OSes handle the root of their process
tree.

> Proced already provides a function proced-process-tree. It seems to
> me that all one needs for making this more robust is a more accurate
> rule of how system-process-attributes handles the ppid attribute in
> certain special cases.

A low-level primitive such as system-process-attributes should know
nothing about its users, ideally.  It should just return whatever the
OS tells it.  It should not adapt its handling of ppid to what its
callers might like or dislike.

> (And I expect that proced could easily work around in a robust way
> if no such rule was implemented. Simply, up to now I didn't worry
> about that when I wrote the proced code.)

I don't see how can you work around that without testing if you are on
windows-nt system or not.




  reply	other threads:[~2008-12-21 19:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-20  2:52 proced: ppid of process ID 0 can be 0 Juanma Barranquero
2008-12-20  3:27 ` Stefan Monnier
2008-12-20  4:31   ` Chong Yidong
2008-12-20 19:10     ` Stefan Monnier
2008-12-20 10:20   ` Juanma Barranquero
2008-12-20 11:34 ` Eli Zaretskii
2008-12-20 19:41   ` Roland Winkler
2008-12-20 21:02     ` Juanma Barranquero
2008-12-20 22:02     ` Eli Zaretskii
2008-12-20 22:41       ` Roland Winkler
2008-12-21  4:15         ` Eli Zaretskii
2008-12-21  4:48           ` Roland Winkler
2008-12-21 19:17             ` Eli Zaretskii [this message]
2008-12-21 21:26               ` Juanma Barranquero
2008-12-22  4:09                 ` Eli Zaretskii
2008-12-22 10:41                   ` Juanma Barranquero
2008-12-22 19:17                     ` Eli Zaretskii
2008-12-22 19:26                       ` Juanma Barranquero
2008-12-22  2:45               ` Stefan Monnier
2008-12-22  4:08                 ` Eli Zaretskii
2008-12-22  4:17                   ` Miles Bader
2008-12-22 19:10                     ` Eli Zaretskii
2008-12-22  8:54                   ` Harald Hanche-Olsen
2008-12-22 10:43                     ` Juanma Barranquero
2008-12-22 10:50                       ` Harald Hanche-Olsen
2008-12-22 18:03                       ` Giorgos Keramidas
2008-12-22 10:59                   ` Andreas Schwab
2008-12-22 19:22                     ` Eli Zaretskii
2008-12-22 19:37                       ` David De La Harpe Golden
2008-12-22 19:59                       ` Andreas Schwab
2008-12-22 12:23                   ` Stefan Monnier
2008-12-22 19:57                     ` Eli Zaretskii
2008-12-22 22:24                       ` Stefan Monnier
2008-12-23  4:02                         ` Eli Zaretskii
2008-12-23 12:28                           ` Roland Winkler
2008-12-23 14:44                           ` Stefan Monnier
2008-12-23 19:12                             ` Eli Zaretskii
2008-12-23 20:41                               ` Stefan Monnier
2008-12-23 22:34                                 ` Giorgos Keramidas
2008-12-24  2:34                                   ` Stefan Monnier
2008-12-24  4:14                                     ` Eli Zaretskii
2008-12-24 16:47                                       ` Stefan Monnier
2008-12-24  4:15                                 ` Eli Zaretskii
2008-12-24 16:47                                   ` Stefan Monnier
2008-12-24 18:29                                     ` Eli Zaretskii
2008-12-24 18:55                                       ` Stefan Monnier
2008-12-24 21:12                                         ` Eli Zaretskii
2008-12-30 17:11                                           ` Stefan Monnier
2008-12-30 22:02                                             ` Eli Zaretskii
2008-12-31  1:40                                               ` Stefan Monnier
2008-12-22  8:28               ` Ulrich Mueller
2008-12-21  2:18       ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2008-12-24  7:42 grischka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u3aghe3sp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Roland.Winkler@physik.uni-erlangen.de \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.