summaryrefslogtreecommitdiffstats
path: root/source3/lib/system.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-11-19 13:33:06 +0000
committerJeremy Allison <jra@samba.org>2014-12-07 00:12:07 +0100
commit97b2570a5e526273476d3990bcef0ac074b34d67 (patch)
tree7a495f0757d199b4a9f736048bd971160b7bedf4 /source3/lib/system.c
parenta25e913cf58c0490755d5a555e2175ae2e74e24e (diff)
downloadsamba-97b2570a5e526273476d3990bcef0ac074b34d67.tar.gz
samba-97b2570a5e526273476d3990bcef0ac074b34d67.tar.xz
samba-97b2570a5e526273476d3990bcef0ac074b34d67.zip
lib: Split out sys_[read|write] & friends
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c90
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.
********************************************************************/