Epoll on regular files

Cartesius00 picture Cartesius00 · Nov 8, 2011 · Viewed 8.4k times · Source

Can epoll (on Linux) be somehow useful for regular files? I know it's primarily used with sockets but just wonder.

Answer

duskwuff -inactive- picture duskwuff -inactive- · Nov 8, 2011

Not really. epoll only makes sense for file descriptors which would normally exhibit blocking behavior on read/write, like pipes and sockets. Normal file descriptors will always either return a result or end-of-file more or less immediately, so epoll wouldn't do anything useful for them.