SIGIO arriving for file descriptors I did not set it for and when no IO is possible
问题 I am trying to receive a signal when I/O is possible on a file descriptor. The program needs to be doing something else when it is not doing I/O, so using select(2) is not an option. When I run the sample code is below, it is printing the message from inside the handler as fast as it can, even when there is no data on stdin. Even weirder is that the file descriptor reported in the siginfo_t structure varies from run to run. I only set it up for stdin (fd 0); why would the handler report any