Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - kill(-1,sig) is not POSIX-conformant: (4 Items)
   
kill(-1,sig) is not POSIX-conformant  
Isn't POSIX just a pain sometimes :)

"If pid is -1, sig shall be sent to all processes (excluding an unspecified set of system processes) for which the 
process has permission to send that signal."

The Neutrino version gives an ESRCH (even in 6.4 according to services/system/ker/ker_signal.c).

  dB
Re: kill(-1,sig) is not POSIX-conformant  
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?


On Fri, Nov 23, 2007 at 07:52:34PM -0500, David Bacon wrote:
> Isn't POSIX just a pain sometimes :)
> 
> "If pid is -1, sig shall be sent to all processes (excluding an
> unspecified set of system processes) for which the process has
> permission to send that signal."
> 
> The Neutrino version gives an ESRCH (even in 6.4 according to
> services/system/ker/ker_signal.c).
> 
>   dB
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post2920

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
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?
>
>
> On Fri, Nov 23, 2007 at 07:52:34PM -0500, David Bacon wrote:
> > Isn't POSIX just a pain sometimes :)
> >
> > "If pid is -1, sig shall be sent to all processes (excluding an
> > unspecified set of system processes) for which the process has
> > permission to send that signal."
> >
> > The Neutrino version gives an ESRCH (even in 6.4 according to
> > services/system/ker/ker_signal.c).
> >
> >   dB
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post2920
>
> -- 
> Brian Stecher (bstecher@qnx.com)        QNX Software Systems
> phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
>        +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post2929
>

-- 
cburgess@qnx.com

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