|
From: | Paul Eggert |
Subject: | Re: Handling fatal signals in GNU make |
Date: | Sun, 9 Jun 2019 15:47:21 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/9/19 3:11 PM, Paul Smith wrote:
This is what sigsuspend is for.Unfortunately sigsuspend() is not an option since it's not available on Windows (as far as I can tell).
On platforms lacking sigsuspend, perhaps you could use the self-pipe trick. That is, your SIGCHILD handler simply writes a byte into a pipe, and you use select+read+waitpid to turn the SIGCHLD signal into a selectable event. See, for example:
https://stackoverflow.com/questions/282176/waitpid-equivalent-with-timeoutDoesn't GNU Make already do something like this already with the jobserver pipe? If so, this may be a better solution even on more-standard platforms. If not, sigsuspend might still be a better choice on the more-standard platforms that have it, as it should be less hacky.
[Prev in Thread] | Current Thread | [Next in Thread] |