while (xconn->smb2.send_queue != NULL) {
struct smbd_smb2_send_queue *e = xconn->smb2.send_queue;
bool ok;
+ struct msghdr msg;
if (e->sendfile_header != NULL) {
size_t size = 0;
continue;
}
- ret = writev(xconn->transport.sock, e->vector, e->count);
+ msg = (struct msghdr) {
+ .msg_iov = e->vector,
+ .msg_iovlen = e->count,
+ };
+
+ ret = sendmsg(xconn->transport.sock, &msg, 0);
if (ret == 0) {
/* propagate end of file */
return NT_STATUS_INTERNAL_ERROR;
bool retry;
NTSTATUS status;
NTTIME now;
+ struct msghdr msg;
if (!NT_STATUS_IS_OK(xconn->transport.status)) {
/*
state->vector.iov_len = NBT_HDR_SIZE;
}
- ret = readv(xconn->transport.sock, &state->vector, 1);
+ msg = (struct msghdr) {
+ .msg_iov = &state->vector,
+ .msg_iovlen = 1,
+ };
+
+ ret = recvmsg(xconn->transport.sock, &msg, 0);
if (ret == 0) {
/* propagate end of file */
return NT_STATUS_END_OF_FILE;