Why does poll keep returning although there is no input?
I wrote a small test program to figure out how to talk to poll . I created three files testa , testb , testc and wrote the string hello\n to the first. So, here is my invocation of poll : poll(polls.data(),polls.size(),-1) According to the manpage, a timeout of -1 should indicate that the syscall never times out. However, it keeps returning without having anything to read. I always consume one byte of the input and can see the hello\n being printed, but poll doesn't stop there. It just keeps on pretending there to be something to read. #include <sys/types.h> #include <sys/stat.h> #include <sys