[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0607141535070.2463@alien.or.mcafeemobile.com>
Date: Fri, 14 Jul 2006 15:38:55 -0700 (PDT)
From: Davide Libenzi <davidel@...ilserver.org>
To: Michael Lindner <mikell@...online.net>
cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: PROBLEM: epoll_wait() returns wrong events for EOF with EPOLLOUT
On Fri, 14 Jul 2006, Michael Lindner wrote:
> [2.] Full description of the problem/report:
> If a program is waiting in epoll_wait() for EPOLLOUT event on a
> socket and the socket is closed, epoll_wait() returns EPOLLHUP|EPOLLERR,
> but *not* EPOLLOUT.
>
> This differs from the expected behavior in several ways:
>
> 1. epoll_wait is not returning the events it was told to wait for.
> Why not return EPOLLOUT? select() returns an FD as writable on EOF.
Because it is not supposed to.
> 2. epoll_wait() is returning events it was not told to wait for.
Because they are non-maskeable.
> 3. EPOLLHUP is not returned if EPOLLIN was requested, why
> do so on EPOLLOUT?
Please take a look at the POSIX docs for poll(2).
> Also a minor issue - epoll_ctl doesn't check if the fd in events.data.fd
> is the same as the fd that's been passed in as argument 3. If they differ
> (due to programmer error), epoll_wait will return an event with the
> incorrect events.data.fd specified to epoll_ctl().
That's an opaque union and epoll couldn't care less of the content.
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists