[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] resuming libevent2 after closing all file descriptors
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] resuming libevent2 after closing all file descriptors
- From: Péter Szabó <ptspts@xxxxxxxxx>
- Date: Mon, 3 May 2010 11:51:14 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 03 May 2010 05:51:22 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=8fvm7oqNDnszKwnPuBzu0iDzPF1oHQZ70xaTGcO6+No=; b=QWfbHEZnIuAym3ydxC87hJ0fU5dHwovbwTOZBR0B3vC/SY/HyL5bIBf1f2IjKPFF1D Yoz9X+FEPru9kTsxh6XCqhW78k5NoY9xvLNt2HmwQl4WXNFUqWpqB+jgEwAsd37ojSh9 792CStKrIseVgmVaeZjZ2roeRm7xSI8bHkQ7M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=xjpiZSwCCZMVrSHuRZpUI9C2mFiFVqWtTQlhzkbHGmmjhjGnX4TXh52Mi8DPLCVi01 hqzmnaf7RbV8UYzGlyWlGWBmpKEToN5SCjoWKvG7KAw346DBknpORWpqwyG3KTBKEVR5 wLtjreIMQiqz7MeJWFxHw8nWz21rkySkUTL3Y=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
I'm doing the following with libevent 2.0.4 on Linux:
strcut event_base *base = event_init()
... /* not registering any events */
for (int fd = 3; fd < 256; ++fd) close(fd);
event_reinit(base);
...
This eventually reports the following warning:
[warn] Epoll ADD on fd 7 failed. Old events were 0; read change was
1; write change was 0.: Bad file descriptor
From ls -l /pro/self/fd, it seems that libevent opens a socketpair on
fds 7 and 8, which I close with close(fd), but event_reinit(base)
doesn't create the new socketpair. Do you think it would be possible
to recreate the socketpairs?
Please note that technically it would be very cumbersome for me to
call event_init() after the close(fd) loop.
Thanks,
Péter
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.