From: Cigy Cyriac Date: Tue, 10 Aug 2010 23:49:43 +0000 (-0400) Subject: Not all platforms have MSG_DONTWAIT X-Git-Tag: fio-1.43-rc1~9 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f5886fef7eb0c44ec854d00a70acc0dfc4975efa;ds=sidebyside Not all platforms have MSG_DONTWAIT Signed-off-by: Jens Axboe --- diff --git a/engines/net.c b/engines/net.c index c0a793e8..9e6e789e 100644 --- a/engines/net.c +++ b/engines/net.c @@ -223,7 +223,10 @@ static int fio_netio_splice_out(struct thread_data *td, struct io_u *io_u) static int fio_netio_send(struct thread_data *td, struct io_u *io_u) { struct netio_data *nd = td->io_ops->data; - int ret, flags = MSG_DONTWAIT; + int ret, flags = 0; +#ifdef MSG_DONTWAIT + flags = MSG_DONTWAIT; +#endif do { if (nd->net_protocol == IPPROTO_UDP) { @@ -251,7 +254,9 @@ static int fio_netio_send(struct thread_data *td, struct io_u *io_u) if (ret <= 0) break; +#ifdef MSG_DONTWAIT flags &= ~MSG_DONTWAIT; +#endif } while (1); return ret; @@ -276,7 +281,10 @@ static int is_udp_close(struct io_u *io_u, int len) static int fio_netio_recv(struct thread_data *td, struct io_u *io_u) { struct netio_data *nd = td->io_ops->data; - int ret, flags = MSG_DONTWAIT; + int ret, flags = 0; +#ifdef MSG_DONTWAIT + flags = MSG_DONTWAIT; +#endif do { if (nd->net_protocol == IPPROTO_UDP) { @@ -299,7 +307,9 @@ static int fio_netio_recv(struct thread_data *td, struct io_u *io_u) ret = poll_wait(td, io_u->file->fd, POLLIN); if (ret <= 0) break; +#ifdef MSG_DONTWAIT flags &= ~MSG_DONTWAIT; +#endif flags |= MSG_WAITALL; } while (1);