This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Documentation of eventfd_write and eventfd_read?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]