summaryrefslogtreecommitdiff
path: root/source/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-21 23:22:30 +0100
committerKarolin Seeger <kseeger@samba.org>2009-01-02 12:44:25 +0100
commita443c09ee81416394592bafbba40620705166da6 (patch)
tree519ecaa4029ebfce2111de91446d41b111eface7 /source/lib
parent85e721c1fb8a1a5f0b49ccf0f7c6865f6eb4fe5b (diff)
downloadsamba-a443c09ee81416394592bafbba40620705166da6.tar.gz
Add sys_writev
(cherry picked from commit 886ebe3b6f7b5304ae9c185ee14a444977afac24)
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/system.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index eabb6d6dc48..5b06d3c7600 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -142,6 +142,20 @@ ssize_t sys_write(int fd, const void *buf, size_t count)
}
/*******************************************************************
+A writev wrapper that will deal with EINTR.
+********************************************************************/
+
+ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt)
+{
+ ssize_t ret;
+
+ do {
+ ret = writev(fd, iov, iovcnt);
+ } while (ret == -1 && errno == EINTR);
+ return ret;
+}
+
+/*******************************************************************
A pread wrapper that will deal with EINTR and 64-bit file offsets.
********************************************************************/