Documentation of eventfd_write and eventfd_read?

Carlos O'Donell carlos@redhat.com
Mon Feb 3 16:37:00 GMT 2014


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.



More information about the Libc-help mailing list