emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proced: ppid of process ID 0 can be 0


From: Roland Winkler
Subject: Re: proced: ppid of process ID 0 can be 0
Date: Sun, 21 Dec 2008 05:48:00 +0100

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. Though I didn't
look at pstree's source code, I guess it is doing its job by
analyzing ppid's.

Dan Nicolaescu had suggested ("wishlist") that it would be nice to
have an emacs/proced implementation of pstree. I guess he is right.
Often it might be much easier to manipulate processes if proced
didn't present the processes in some linear order; but instead it
made the tree structure with parents and children transparent.

> > Is there any possiblity missing?
> 
> Maybe not, but that's not what I was asking.  I was asking why you
> need the assumption about this behavior.  I now understand that it is
> only for handling processes as a tree.  So I will write a primitive
> for the root of that tree that Lisp code should use for such
> decisions.

Somehow I am missing the point here. Why do you think it is
necessary or advantageous to have a separate primitive for that?
Isn't it more transparent to implement this on the lisp level?

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. (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.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]