> Ok, so that is two things that need to be in the manpage and probably in
> bold:
>
> 1) epoll only works on pipes and sockets
> (not on tty, not on files)
>
> 2) epoll must be used on non-blocking sockets only
> (and describe the race that happens otherwise)
>
> If you send me the source of your manpages I'll work it in if you want.
No problem ...
> I still vote for checking at insert time however unless that is too
> expensive. Yes, we want people to read the manpages and heed them, but we
> also not want to create interfaces that are needlessly errorprone.
This will make the API to be really error prone by giving the user the
impression that he can go sleeping for a given fd each time he wants. The
rule "you can wait for events only after you received EAGAIN" looks like a
very short and precise rule. On the contrary of "you can go wait for
events after you received EAGAIN or after accept/connect". And the fact on
using the fd immediately after an accept/connect is enforced by two very
likely facts :
1) on accept() it's very likely that the first packet brough you something
more than SYN
2) on connect() you have the full I/O write space available
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/