The reader will recall that, in Chapter 1, Linux System Architecture, in the section entitled, The Unix philosophy in a nutshell, we drove home the point that a cornerstone of the Unix philosophy is this:
On Unix, everything is a process; if it's not a process, it's a file.
Experienced Unix and Linux developers are very used to the idea (abstraction, really) of treating stuff as if it were a file; this includes devices, pipes, and sockets. Why not signals?
That's precisely the idea behind the signalfd(2) system call; with signalfd, you can create a file descriptor and associate it with a signal set. Now, the application programmer is free to monitor signals using a variety of familiar file-based APIs—among them the