From: Davide Libenzi <davidel@xmailserver.org>
To: Ben <linux-kernel-junk-email@slimyhorror.com>
Cc: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Fw: epoll and fork()
Date: Tue, 2 Mar 2004 07:05:26 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.44.0403020654080.24044-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <20040302050233.3b33188b.akpm@osdl.org>
>
> Is there a defined behaviour for what happens when a process with an epoll
> fd forks?
>
> 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?
epoll does register the underlying file* not the fd, so this is the
expected behaviour. Inheriting an fd, and epoll is no exception, simply
bumps a counter, so both parent and child epoll fd shares the same context.
Sorry but what behaviour do you expect by unregistering an fd pushed by
the parent from inside a child? Events work exactly the same. Since the
context is shared, events are delivered only once.
- Davide
next parent reply other threads:[~2004-03-02 15:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040302050233.3b33188b.akpm@osdl.org>
2004-03-02 15:05 ` Davide Libenzi [this message]
2004-03-02 15:25 ` Chris Friesen
2004-03-03 10:38 ` Davide Libenzi
2004-03-02 15:38 ` Ben
2004-03-02 15:44 ` Mark Mielke
2004-03-03 10:29 ` 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.44.0403020654080.24044-100000@bigblue.dev.mdolabs.com \
--to=davidel@xmailserver.org \
--cc=akpm@osdl.org \
--cc=linux-kernel-junk-email@slimyhorror.com \
--cc=linux-kernel@vger.kernel.org \
/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®