1 #ifndef IOLOOP_NOTIFY_FD_H 2 #define IOLOOP_NOTIFY_FD_H 3 4 /* common notify code for fd-based notifications (dnotify, inotify) */ 5 6 struct io_notify { 7 struct io io; 8 9 /* use a doubly linked list so that io_remove() is quick */ 10 struct io_notify *prev, *next; 11 12 int fd; 13 }; 14 15 struct ioloop_notify_fd_context { 16 struct io_notify *notifies; 17 }; 18 19 struct io * 20 io_notify_fd_add(struct ioloop_notify_fd_context *ctx, int fd, 21 io_callback_t *callback, void *context) ATTR_NULL(4); 22 void io_notify_fd_free(struct ioloop_notify_fd_context *ctx, 23 struct io_notify *io); 24 25 struct io_notify * 26 io_notify_fd_find(struct ioloop_notify_fd_context *ctx, int fd); 27 28 #endif 29