Date:        Wed, 10 May 2017 14:44:43 +0200
    From:        Vincent Lefevre <vincent-o...@vinc17.net>
    Message-ID:  <20170510124443.gd25...@cventin.lip.ens-lyon.fr>

  | But wouldn't it be useful to have the list of terminated processes as
  | a new POSIX feature for shells?

Yes, it would, but I don't personally believe that SIGCHLD is the
mechanism to use to achieve that.   The issue is really that the
shell's wait command hasn't kept up with the system call.

The shells know what processes have exited, and their exit status,
there is just no standard way of communicating the info into the
script.   If wait were a little more flexible, and allowed waiting
for any process (like bash's does) and also returned the process
(and/or job) id of the process that exited, then the script would be
able to manage processes.

But while we have just "wait for this specific process, and hang
while doing it" or "wait for everything to finish, and hang while
doing it" there just is not enough info to accomplish much.
Even if we get a CHLD trap, there's no standard way to know which
(or even how many) process(es) exited to cause it.

But it is not the job of this group to invent some better interface.

Rather the implementors should be doing that, and then once there
appears a popular common solution, then it can be standardised.

Some of what bash is doing might be providing the lead for some of
this (some  of what they have I plan to copy, and then probably add
a little more, and hope that perhaps others will copy...)

kre


Reply via email to