1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

Add sys_writev

This commit is contained in:
Volker Lendecke 2008-12-21 23:22:30 +01:00
parent 102028ec72
commit 6251b97e02
2 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -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.
********************************************************************/