Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261691AbUCBPoC (ORCPT ); Tue, 2 Mar 2004 10:44:02 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261696AbUCBPoC (ORCPT ); Tue, 2 Mar 2004 10:44:02 -0500 Received: from findaloan.ca ([66.11.177.6]:53124 "EHLO mark.mielke.cc") by vger.kernel.org with ESMTP id S261691AbUCBPn7 (ORCPT ); Tue, 2 Mar 2004 10:43:59 -0500 Date: Tue, 2 Mar 2004 10:42:02 -0500 From: Mark Mielke To: Ben Cc: linux-kernel@vger.kernel.org Subject: Re: epoll and fork() Message-ID: <20040302154202.GA24226@mark.mielke.cc> Mail-Followup-To: Ben , linux-kernel@vger.kernel.org References: 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: 1312 Lines: 33 On Tue, Mar 02, 2004 at 12:31:20PM +0000, Ben wrote: > Is there a defined behaviour for what happens when a process with an epoll > fd forks? You found it. :-) > I've an app that inherits an epoll fd from its parent, and then > unregisters some file descriptors from the epoll set. This seems to have > the nasty side effect of unregistering the same file descriptors from the > parent process as well. Surely this can't be right? The epoll fd should probably be closed after the fork(), re-allocated, and then initialized to contain the file descriptors that you want to watch. mark -- mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/ - 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/