This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Documentation of eventfd_write and eventfd_read?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Hei Chan <structurechart at yahoo dot com>, "Carlos O'Donell" <carlos at systemhalted dot org>
- Cc: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Mon, 03 Feb 2014 11:37:23 -0500
- Subject: Re: Documentation of eventfd_write and eventfd_read?
- Authentication-results: sourceware.org; auth=none
- References: <1391187311 dot 91829 dot YahooMailNeo at web165005 dot mail dot bf1 dot yahoo dot com> <CAE2sS1g-Fct7OG9TconTrPLQH3kFE-WTqdXtY+JXihLV=vXP=Q at mail dot gmail dot com> <1391234045 dot 17651 dot YahooMailNeo at web165006 dot mail dot bf1 dot yahoo dot com>
On 02/01/2014 12:54 AM, Hei Chan wrote:
> Sounds like a bug that epoll_wait() doesn't return when
> eventfd_write() is called with zero as the 2nd argument?
It's a bug somewhere.
An eventfd_t value of 0 does not impact the fact that the
underlying write uses &value and writes the size of the
descriptor into the buffer.
That should be sufficient to wake any waiter that is
waiting on data.
The better question is:
Is it valid to use an eventfd fd in epoll_wait which
expects an epoll fd?
I don't know how well tested this is, but one would expect
it to work on any fd.
Cheers,
Carlos.