fcntl(fd, F_SETOWN, getpid()); doesn't seem to work on Linux to get generate a signal when an event on the GPIO fd occurs. So fall back to the same method as on OS X and call poll() in a child process.