diff options
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r-- | source3/lib/system.c | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index 6478e6f512..7531d771ce 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -50,96 +50,6 @@ expansions/etc make sense to the OS should be acceptable to Samba. */ - - -/******************************************************************* -A read wrapper that will deal with EINTR. -********************************************************************/ - -ssize_t sys_read(int fd, void *buf, size_t count) -{ - ssize_t ret; - - do { - ret = read(fd, buf, count); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)); - - return ret; -} - -/******************************************************************* -A write wrapper that will deal with EINTR. -********************************************************************/ - -ssize_t sys_write(int fd, const void *buf, size_t count) -{ - ssize_t ret; - - do { - ret = write(fd, buf, count); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)); - - 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; - -#if 0 - /* Try to confuse write_data_iov a bit */ - if ((random() % 5) == 0) { - return sys_write(fd, iov[0].iov_base, iov[0].iov_len); - } - if (iov[0].iov_len > 1) { - return sys_write(fd, iov[0].iov_base, - (random() % (iov[0].iov_len-1)) + 1); - } -#endif - - do { - ret = writev(fd, iov, iovcnt); - } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)); - - return ret; -} - -/******************************************************************* -A pread wrapper that will deal with EINTR -********************************************************************/ - -#if defined(HAVE_PREAD) -ssize_t sys_pread(int fd, void *buf, size_t count, off_t off) -{ - ssize_t ret; - - do { - ret = pread(fd, buf, count, off); - } while (ret == -1 && errno == EINTR); - return ret; -} -#endif - -/******************************************************************* -A write wrapper that will deal with EINTR -********************************************************************/ - -#if defined(HAVE_PWRITE) -ssize_t sys_pwrite(int fd, const void *buf, size_t count, off_t off) -{ - ssize_t ret; - - do { - ret = pwrite(fd, buf, count, off); - } while (ret == -1 && errno == EINTR); - return ret; -} -#endif - /******************************************************************* A send wrapper that will deal with EINTR or EAGAIN or EWOULDBLOCK. ********************************************************************/ |