lkml.org 
[lkml]   [2004]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Is POLLHUP an input-only or bidirectional condition? (was: epoll reporting events when it hasn't been asked to)
Davide Libenzi wrote:
> > Btw, I notice epoll never reports POLLNVAL. Is that correct?
>
> Yep, epoll does not allow you to push an invalid/unopen file descriptor
> inside the set. So you get an EBADF from epoll_ctl().

A comment in eventpoll.c says:

* This semaphore is acquired by ep_free() during the epoll file
* cleanup path and it is also acquired by eventpoll_release()
* if a file has been pushed inside an epoll set and it is then
* close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL).

I.e. implying that the final close() is possible while it's registered.
(Btw, a function called eventpoll_release() doesn't exist).

What happens when a file descriptor is closed while it is inside the set?

I guess it's simply dropped from the set, is that right?

-- Jamie
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.062 / U:8.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site