Re: epoll and shared fd's

From: Davide Libenzi
Date: Thu Feb 28 2008 - 14:27:55 EST


On Thu, 28 Feb 2008, Valdis.Kletnieks@xxxxxx wrote:

> On Tue, 26 Feb 2008 19:16:30 +0100, Bodo Eggert said:
> > Michael Kerrisk <mtk.manpages@xxxxxxxxxxxxxx> wrote:
>
> > > file handle have been closed. This means that
> > > even after a file descriptor that is part of an
> > > epoll set has been closed, events may be reported
> > > for that file descriptor if other file descriptors
> > > referring to the same underlying file description
> > > remain open.
>
> Is it worth making special mention of the case where a process gets events
> for a FD that it has closed, because a parent or child process still has
> an inherited copy of the FD still open?

And for all the others, there's epoll_ctl(EPOLL_CTL_DEL) :)
The close(2) (f_op->release actually) hook is for cleanup semantics. If
you play with multiple processes, just use epoll_ctl(EPOLL_CTL_DEL) and
you'll be fine.



- Davide


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/