+ unsigned int curgen = io_tree.generation;
+
+
+#ifdef HAVE_SYS_EPOLL_H
+
+ for(int i = 0; i < n; i++) {
+ io_t *io = events[i].data.ptr;
+
+ if(events[i].events & EPOLLOUT && io->flags & IO_WRITE) {
+ io->cb(io->data, IO_WRITE);
+ }
+
+ if(curgen != io_tree.generation) {
+ break;
+ }
+
+ if(events[i].events & EPOLLIN && io->flags & IO_READ) {
+ io->cb(io->data, IO_READ);
+ }
+
+ if(curgen != io_tree.generation) {
+ break;
+ }
+ }
+
+#else
+