Re: epoll vs stdin/stdout

From: Davide Libenzi (
Date: Mon Jul 07 2003 - 13:57:02 EST

On Mon, 7 Jul 2003, Eric Varsanyi wrote:

> It seems reasonable to register for read events on stdin and write events
> on stdout. In an earlier posting on the epoll API it was asserted that
> anyone registering for events on 2 fd's that shared the same file * was
> asking for trouble.
> I can imagine many apps that might want to proxy async traffic thru
> stdin/stdout, what is the intended general solution for this with epoll?
> FWIW in my app I'm just assuming that fd0 is a dup of fd1 if EPOLL_CTL_ADD
> on fd1 fails with EEXISTS, then I EPOLL_CTL_MOD on fd0 to add the write event.
> This seems like a bit of a hack tho.

Events caught by epoll comes from a file* since that is the abstraction
the kernel handles. Events really happen on the file* and there's no way
if you dup()ing 1000 times a single fd, to say that events are for fd = 122.

- Davide

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:30 EST