X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Fio%2Fio.h;h=1e4e80e7db779410b72a80428c65b12e8137218f;hb=3ffb94e9aad84dc0d8e19a5a7d709589d7956ddf;hp=11eeade63f820c2be20a296c6c7583f771b002a3;hpb=e846b1a93ecf096164ff2c4faaf4a89c24a0e76b;p=ccan diff --git a/ccan/io/io.h b/ccan/io/io.h index 11eeade6..1e4e80e7 100644 --- a/ccan/io/io.h +++ b/ccan/io/io.h @@ -692,6 +692,16 @@ int io_conn_fd(const struct io_conn *conn); */ bool io_flush_sync(struct io_conn *conn); +/** + * io_fd_block - helper to set an fd blocking/nonblocking. + * @fd: the file descriptor + * @block: true to set blocking, false to set non-blocking. + * + * Generally only fails is @fd isn't a valid file descriptor, otherwise + * returns true. + */ +bool io_fd_block(int fd, bool block); + /** * io_time_override - override the normal call for time. * @nowfn: the function to call.