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 = 0;
-#ifdef MSG_DONTWAIT
- flags = MSG_DONTWAIT;
-#endif
+ int ret, flags = OS_MSG_DONTWAIT;
do {
if (nd->net_protocol == IPPROTO_UDP) {
if (ret <= 0)
break;
-#ifdef MSG_DONTWAIT
- flags &= ~MSG_DONTWAIT;
-#endif
+ flags &= ~OS_MSG_DONTWAIT;
} while (1);
return ret;
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 = 0;
-#ifdef MSG_DONTWAIT
- flags = MSG_DONTWAIT;
-#endif
+ int ret, flags = OS_MSG_DONTWAIT;
do {
if (nd->net_protocol == IPPROTO_UDP) {
ret = poll_wait(td, io_u->file->fd, POLLIN);
if (ret <= 0)
break;
-#ifdef MSG_DONTWAIT
- flags &= ~MSG_DONTWAIT;
-#endif
+ flags &= ~OS_MSG_DONTWAIT;
flags |= MSG_WAITALL;
} while (1);
#define FIO_HAVE_PSHARED_MUTEX
#define OS_MAP_ANON MAP_ANON
+#define OS_MSG_DONTWAIT 0
static inline int blockdev_invalidate_cache(int fd)
{
#include "../lib/strsep.h"
#endif
+#ifdef MSG_DONTWAIT
+#define OS_MSG_DONTWAIT MSG_DONTWAIT
+#endif
+
#ifndef FIO_HAVE_FADVISE
#define fadvise(fd, off, len, advice) (0)