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: Sat, 20 Dec 2008 23:41:00 +0100

On Sun Dec 21 2008 Eli Zaretskii wrote:
> > 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.
> 
> Why do you need to assume that?  Is that only to determine whether a
> given process is the root of the process tree?  If so, a more portable
> way of doing that would be to have a primitive for that with a
> system-dependent implementation.

It's the definition of a tree: when A points back to A, this doesn't
give a process tree. Of course, as I said, for Proced it is not so
important whether system-process-attributes can return a ppid that
equals pid or whether in this case it returns no ppid attribute
(or a ppid=0). It's easy to handle this case on te level of proced.

Yet the current discussion suggests to me that it would be
advantageous if the behavior of system-process-attributes was
documented for this case. It seems to me that the possiblities are:

- it may return a ppid that equals pid, so that one needs to handle
  this case appropriately, if necessary, on the lisp level,

- it may return no ppid, if strictly speaking there is no parent
  process

- it may return a ppid of zero, which is the current behavior under
  GNU/linux

- some or all the above options are "legal" and its up to the user
  to handle these possibilities appropriately

Is there any possiblity missing?

Roland




reply via email to

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