David Bacon(deleted)
|
Re: kill(-1,sig) is not POSIX-conformant
|
David Bacon(deleted)
11/26/2007 12:35 PM
post2938
|
Re: kill(-1,sig) is not POSIX-conformant
> QNX4 had that lovely PF_SERVER flag... ;-)
>
> Brian Stecher wrote:
> >
> > Actually I would argue that we are POSIX conformant - not very useful,
> > but
> > conformant. There's a lot of wiggle room in "unspecified set": since one
> > man's application is another's system process in a microkernel, we
> > designate all the running processes as belonging to the set. Since we
> > don't send the signal to anybody, the ESRCH return is proper.
> >
> > Anybody got a better idea on how to separate an application from a
> > system process? Possibly if something's called procmgr_daemon(), or
> > has the _NTO_PF_NOZOMBIE flag set?
> >
Exclude women's applications? :)
Admittedly, this is a bit of a corner case, but if you want to enter the murky realm of the "useful", the questions that
arise have much in common with those which confront the shutdown(int,int) of libshutdown (not to be confused with the
shutdown(int,int) of libsocket--woe to hir who would link both!). And this may be an opportunity to formalize the rules
a bit; shutdown() is deplorably ad-hoc in its approach.
For a non-root caller of kill(-1,sig), "useful" might include all processes owned by that caller.
For a root caller, it might actually be reasonable to send the signal to all processes other than procnto. There would
normally still be some survivors except when the signal was uncatchable. Or, if procmgr_daemon() is indeed called by
all "fundamental" system processes, a new flag called PROCMGR_DAEMON_ESSENTIAL or something could be used to mark them
for exclusion from mass killings.
For embedded systems, it might be nice if such a flag could be set on a process at the time of its launch, regardless of
whether it happened to call procmgr_daemon(), using some new option to the "on" command. For example, one might be
running only io-usb and devb-umass, not devb-eide, and want them to have similar default survival properties as would be
appropriate for devb-eide on a workstation.
dB
|
|
|