References:
https://www.linuxprogrammingblog.com/code-examples/using-pselect-to-avoid-a-signal-race
M.J. Rochkind, Advanced Unix Programming book.
https://lwn.net/Articles/176911/
https://stackoverflow.com/questions/6962150/catching-signals-while-reading-from-pipe-with-select