Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262110AbUDDCJH (ORCPT ); Sat, 3 Apr 2004 21:09:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262117AbUDDCJH (ORCPT ); Sat, 3 Apr 2004 21:09:07 -0500 Received: from mail.shareable.org ([81.29.64.88]:7831 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S262110AbUDDCJF (ORCPT ); Sat, 3 Apr 2004 21:09:05 -0500 Date: Sun, 4 Apr 2004 03:08:51 +0100 From: Jamie Lokier To: Davide Libenzi Cc: Ben Mansell , Steven Dake , Linux Kernel Mailing List Subject: Re: Is POLLHUP an input-only or bidirectional condition? (was: epoll reporting events when it hasn't been asked to) Message-ID: <20040404020851.GB7074@mail.shareable.org> References: <20040403223541.GB6122@mail.shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1031 Lines: 26 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/