From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: emacs-devel@gnu.org
Subject: Re: SIGCHLD in vfork child context
Date: Fri, 19 May 2017 12:19:39 +0900 [thread overview]
Message-ID: <wlvaoxleic.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <a8f4c9e7-e11f-a33d-e5a0-c4137932ff0b@cs.ucla.edu>
>>>>> On Tue, 16 May 2017 01:58:37 -0700, Paul Eggert <eggert@cs.ucla.edu> 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
mituharu@math.s.chiba-u.ac.jp
next prev parent reply other threads:[~2017-05-19 3:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-13 5:41 SIGCHLD in vfork child context YAMAMOTO Mitsuharu
2017-05-15 1:04 ` YAMAMOTO Mitsuharu
2017-05-16 8:58 ` Paul Eggert
2017-05-16 9:19 ` Andreas Schwab
2017-05-16 9:50 ` Paul Eggert
2017-05-16 10:22 ` Andreas Schwab
2017-05-19 7:16 ` Paul Eggert
2017-05-19 3:19 ` YAMAMOTO Mitsuharu [this message]
2017-05-19 7:18 ` Paul Eggert
2017-05-20 8:22 ` YAMAMOTO Mitsuharu
2017-05-21 8:49 ` Paul Eggert
2017-05-21 8:53 ` mituharu
2017-05-21 9:01 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlvaoxleic.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).