+static int fio_netio_splice_out(struct thread_data *td, struct io_u *io_u)
+{
+ errno = EOPNOTSUPP;
+ return -1;
+}
+#endif
+
+static int fio_netio_send(struct thread_data *td, struct io_u *io_u)
+{
+ int flags = 0;
+
+ /*
+ * if we are going to write more, set MSG_MORE
+ */
+#ifdef MSG_MORE
+ if (td->this_io_bytes[DDIR_WRITE] + io_u->xfer_buflen < td->o.size)
+ flags = MSG_MORE;
+#endif
+
+ return send(io_u->file->fd, io_u->xfer_buf, io_u->xfer_buflen, flags);
+}
+
+static int fio_netio_recv(struct io_u *io_u)
+{
+ int flags = MSG_WAITALL;
+
+ return recv(io_u->file->fd, io_u->xfer_buf, io_u->xfer_buflen, flags);
+}
+
+static int fio_netio_queue(struct thread_data *td, struct io_u *io_u)
+{
+ struct netio_data *nd = td->io_ops->data;
+ int ret;
+
+ fio_ro_check(td, io_u);
+
+ if (io_u->ddir == DDIR_WRITE) {
+ if (nd->use_splice)
+ ret = fio_netio_splice_out(td, io_u);
+ else
+ ret = fio_netio_send(td, io_u);
+ } else if (io_u->ddir == DDIR_READ) {
+ if (nd->use_splice)
+ ret = fio_netio_splice_in(td, io_u);
+ else
+ ret = fio_netio_recv(io_u);
+ } else
+ ret = 0; /* must be a SYNC */
+
+ if (ret != (int) io_u->xfer_buflen) {
+ if (ret >= 0) {
+ io_u->resid = io_u->xfer_buflen - ret;
+ io_u->error = 0;
+ return FIO_Q_COMPLETED;
+ } else
+ io_u->error = errno;