Integrate signal handling with sigaction, sigprocmask, etc. and epoll_pwait.