X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fio%2Fio.h;h=11eeade63f820c2be20a296c6c7583f771b002a3;hp=fe42b53736005c4459c3b56afbbaa87ffe46f04a;hb=e846b1a93ecf096164ff2c4faaf4a89c24a0e76b;hpb=d00c9d1be5a56fbf990882f9a6da5704b3f1ea75 diff --git a/ccan/io/io.h b/ccan/io/io.h index fe42b537..11eeade6 100644 --- a/ccan/io/io.h +++ b/ccan/io/io.h @@ -4,6 +4,7 @@ #include #include #include +#include #include struct timers; @@ -701,4 +702,14 @@ bool io_flush_sync(struct io_conn *conn); */ struct timemono (*io_time_override(struct timemono (*now)(void)))(void); +/** + * io_poll_override - override the normal call for poll. + * @pollfn: the function to call. + * + * io usually uses poll() internally, but this forces it to use your + * function (eg. for debugging, suppressing fds, or polling on others unknown + * to ccan/io). Returns the old one. + */ +int (*io_poll_override(int (*poll)(struct pollfd *fds, nfds_t nfds, int timeout)))(struct pollfd *, nfds_t, int); + #endif /* CCAN_IO_H */