From 6251b97e02c890b184e13187020c19c8c2e82f2c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 21 Dec 2008 23:22:30 +0100 Subject: Add sys_writev --- source3/include/proto.h | 1 + source3/lib/system.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5a3776b005..f1be1874bf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -969,6 +969,7 @@ void *sys_memalign( size_t align, size_t size ); int sys_usleep(long usecs); ssize_t sys_read(int fd, void *buf, size_t count); ssize_t sys_write(int fd, const void *buf, size_t count); +ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt); ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off); ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off); ssize_t sys_send(int s, const void *msg, size_t len, int flags); diff --git a/source3/lib/system.c b/source3/lib/system.c index 86c4ef2097..d52d12bf72 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -141,6 +141,20 @@ ssize_t sys_write(int fd, const void *buf, size_t count) return ret; } +/******************************************************************* +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. ********************************************************************/ -- cgit