On Fri, May 10, 2019 at 10:27 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
I think it's necessary to design the spawn process facility to either
(1) take keyword arguments, or (2) use a not-yet-launched-process object
to set options. Then implementations can add their own keyword args /
object accessors to implement extra stuff.

Another option can be a parameter specifying the default sigmask for subprocesses.
It is probably least invasive (most programs can just leave it to the sensible default).
A concern of introducing signal masks is that it will further bloat the srfi, though.
We could just simply mention that spawn() sets the child's signal mask with some sensible default,
ant the customizing the mask will be another srfi.

BTW, what happens if the forked child process receives a signal before
it has time to call exec?

Gauche resets the child process's signal handlers to the default before unblocking signals,
so most likely the child process terminates by the signal.  We don't have a standardized
way for the parent process to detect the situation; however, there are may other causes
that prevents the child process from starting up normally, so the parent process needs to check
the child's health after spawning anyway.