Re: Man page correction: epoll (7)

From: Davide Libenzi
Date: Sun Jul 01 2007 - 13:01:40 EST


On Sun, 1 Jul 2007, Heikki Orsila wrote:

> So, the Q9 should be changed:
>
> Q9 Do I need to continuously read/write an fd until EAGAIN when
> using the EPOLLET flag ( Edge Triggered behaviour ) ?
>
> A9 As a general rule, yes. However, there are exceptions.
> With some types of fds it is enough to wait until
> read returns less bytes than was requested by the read call.
>
> Are there any fd types where such behavior is guaranteed by the Linux
> kernel (for the future)? I.e. one can assume that edge-triggered fds
> will behave properly if
>
> x = read(fd, data, count) and x < count ?
>
> Regular files? Sockets? What?

Basically, any "streaming" file. That is, any file that tends to fill up
the buffer you supply to the call in full (till they have data in their
buffers, that is). Packet/token oriented files would be the ones you
cannot apply the rule to, since data is returned in multiple of tokens.


- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/