SIGCHLD is sent on SIGCONT on Linux but not on macOS

六月ゝ 毕业季﹏ 提交于 2019-12-02 04:04:07

That behavior is optional. An implementation need not generate a SIGCHLD upon continuation. The language used in POSIX.1-2008 (2016 edition) is "may" rather than "shall":

When a stopped process is continued, a SIGCHLD signal may be generated for its parent process, unless the parent process has set the SA_NOCLDSTOP flag.

- System Interfaces, 2.4.3 Signal Actions

...a SIGCHLD signal may be generated for the calling process whenever any of its stopped child processes are continued.

- System Interfaces sigaction "Description"

Emphases added.

Am I missing something?

Probably not.

Is it an expected behaviour?

Probably yes.

OSX is based on 4.4 BSD, and this BSD simply does not support sending a SIGCHLD to the parent when the child continues. Earlier versions of Linux lacked this support as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!