emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGCHLD in vfork child context


From: YAMAMOTO Mitsuharu
Subject: Re: SIGCHLD in vfork child context
Date: Fri, 19 May 2017 12:19:39 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Tue, 16 May 2017 01:58:37 -0700, Paul Eggert <address@hidden> said:

>> It seems that calling waitpid from the SIGCHLD handler results in
>> ECHILD in the vfork child context

> Why is the vfork child process getting a SIGCHLD signal? That process doesn't 
> have any children. Is the macOS kernel simply buggy? If so, I suggest adding 
> a 
> short explanation of the situation to this comment:

>> +    /* Call the SIGCHLD handler in case we have received SIGCHLD in
>> +       the vfork child context.  The signal mask is restored by
>> +       unblock_child_signal below.  */

I'll make the comment for the first hunk more explicit about the
situation:

#ifdef DARWIN_OS
      /* On Darwin, SIGCHLD for status change of a child process can
         be delivered to the vfork child context.  It will confuse the
         SIGCHLD handler because waitpid results in ECHILD there.  */
      signal (SIGCHLD, SIG_DFL);
#endif

>> +    (*action.sa_handler) (SIGCHLD);

> No need for the * and the first set of parens. I.e., this is OK:

>      action.sa_handler (SIGCHLD);

> Otherwise, looks OK; thanks.

Thanks for the comments.

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]