summaryrefslogtreecommitdiffstats
path: root/include/libtf/io.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libtf/io.h')
-rw-r--r--include/libtf/io.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/libtf/io.h b/include/libtf/io.h
index 1f37d81..0d34421 100644
--- a/include/libtf/io.h
+++ b/include/libtf/io.h
@@ -43,9 +43,18 @@ struct tf_fd {
void *waiting_fiber;
};
-void tf_poll_init(void);
-int tf_poll(tf_mtime_diff_t timeout);
-void tf_poll_close(void);
+#define TF_POLL_READ 1
+#define TF_POLL_WRITE 2
+
+struct tf_poll_hooks {
+ void (*init)(void);
+ int (*poll)(tf_mtime_diff_t timeout);
+ void (*close)(void);
+ int (*fd_created)(struct tf_fd *fd);
+ int (*fd_destroyed)(struct tf_fd *fd);
+ void (*fd_monitor)(struct tf_fd *fd, int events);
+ void (*fd_unmonitor)(struct tf_fd *fd);
+};
int tf_open_fd(struct tf_fd *fd, int kfd, int flags);
int tf_open(struct tf_fd *fd, const char *pathname, int flags);