On Sun, May 26, 2019 at 10:01 PM Eugen-Andrei Gavriloaie <shir...@gmail.com> wrote: > > We know that kqueue and epoll can be cascaded. I have a library which is > available only for systems that have kqueue or epoll. Internally, this > library is having a bunch of file descriptors like sockets and timers that > are tested for events using epoll/kqueue. Finally, this library is exposing > this epoll/kqueue fd as an unique file descriptor which designates a session. > This can then be tested for events in other upper layers using epoll/kqueue. > Of course, the only valid event for this cascaded unique file descriptor is > the read event which informs the user of the library that something happened > on that session designated by the file descriptor. > > I have searched a way to convince libuv to accept a generic file descriptor > and listen for read events, but I did not find such a thing. > > Is there a way to tell libuv about an FD and only report back when events are > happening, not actually doing any reading on it? > > Best regards, > Andrei
Yes, there is: http://docs.libuv.org/en/v1.x/poll.html Caveat emptor: Linux lets you watch one epoll fd with another but with kqueue fds that won't work everywhere: http://docs.libuv.org/en/v1.x/loop.html#c.uv_backend_fd -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to libuv+unsubscr...@googlegroups.com. To post to this group, send email to libuv@googlegroups.com. Visit this group at https://groups.google.com/group/libuv. To view this discussion on the web visit https://groups.google.com/d/msgid/libuv/CAHQurc84X_06V1Zx7YnW01eqYz7gcOPDaX61Rb1HWcwBBT%3D%2Bbg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.