mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Michael Lindner <mikell@optonline.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PROBLEM: epoll_wait() returns wrong events for EOF with EPOLLOUT
Date: Fri, 14 Jul 2006 15:38:55 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0607141535070.2463@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <200607141518.58635.mikell@optonline.net>

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



  parent reply	other threads:[~2006-07-14 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-14 19:18 Michael Lindner
2006-07-14 19:27 ` Chase Venters
2006-07-14 22:38 ` Davide Libenzi [this message]
2006-07-14 23:44   ` Michael Lindner
2006-07-15 22:03     ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0607141535070.2463@alien.or.mcafeemobile.com \
    --to=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikell@optonline.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®