Re: Handling fatal signals in GNU make

Paul Eggert <[email protected]> Sun, 9 Jun 2019 15:47:21 -0700
Newsgroups gmane.comp.gnu.make.devel
Organization UCLA Computer Science Department
Message-ID <[email protected]>
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-timeout

Doesn'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.


_______________________________________________
Make-alpha mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/make-alpha