The behavior of signal() for certain things is implementation-dependent. Using sigaction would give more safety guarantees. See the "Portability" section in http://man7.org/linux/man-pages/man2/signal.2.html