summaryrefslogtreecommitdiffstats
path: root/source3/lib/messages.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-02-25 12:15:58 +0000
committerJeremy Allison <jra@samba.org>2014-04-23 22:33:08 +0200
commitcdc99c145d91aaac08886862a38a0e320e10be85 (patch)
treeac3f095080bf7d6d55ef5ca14606099c8b00b192 /source3/lib/messages.c
parente2683605b0c00a0911d59a9123210fe55400a732 (diff)
downloadsamba-cdc99c145d91aaac08886862a38a0e320e10be85.tar.gz
samba-cdc99c145d91aaac08886862a38a0e320e10be85.tar.xz
samba-cdc99c145d91aaac08886862a38a0e320e10be85.zip
messaging3: Add messaging_send_iov
This uses a copy, will be replaced by a direct iovec call through to sendmsg on the unix domain socket Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/messages.c')
-rw-r--r--source3/lib/messages.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 5db1214e448..b4ed80754bd 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -419,6 +419,25 @@ NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
return messaging_send(msg_ctx, server, msg_type, &blob);
}
+NTSTATUS messaging_send_iov(struct messaging_context *msg_ctx,
+ struct server_id server, uint32_t msg_type,
+ const struct iovec *iov, int iovlen)
+{
+ uint8_t *buf;
+ NTSTATUS status;
+
+ buf = iov_buf(talloc_tos(), iov, iovlen);
+ if (buf == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = messaging_send_buf(msg_ctx, server, msg_type,
+ buf, talloc_get_size(buf));
+
+ TALLOC_FREE(buf);
+ return status;
+}
+
static struct messaging_rec *messaging_rec_dup(TALLOC_CTX *mem_ctx,
struct messaging_rec *rec)
{