On Sun, May 19, 2019 at 01:40:59PM +0300, Janne Blomqvist wrote:
>  
> +#if defined(HAVE_SIGACTION) && defined(HAVE_WAITPID)
> +      static bool sig_init_saved;
> +      bool sig_init = __atomic_load_n (&sig_init_saved, __ATOMIC_RELAXED);
> +      if (!sig_init)
> +     {
> +       struct sigaction sa;
> +       sa.sa_handler = &sigchld_handler;
> +       sigemptyset(&sa.sa_mask);
> +       sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
> +       sigaction(SIGCHLD, &sa, 0);
> +       __atomic_store_n (&sig_init_saved, true, __ATOMIC_RELAXED);
> +     }
> +#endif

Where do the prototypes for __atomic_load_n and __atomic_store_n
come from?  On FreeBSD, it seems these are in stdatomic.h.  Do
we need a HAVE_ATOMIC to include the header?

On a slightly different note, the nonstandard SYSTEM intrinsic
uses system(3) to execute a command.  I believe that it will
leave zombies/orphaned children if a process is interrupted.
Perhap, SYSTEM should be reworked to use your EXECUTE_COMMAND_LINE.

-- 
Steve

Reply via email to