summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/system.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 42f9615c9e..d92262a786 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -105,7 +105,6 @@ ssize_t sys_write(int fd, const void *buf, size_t count)
return ret;
}
-
/*******************************************************************
A pread wrapper that will deal with EINTR and 64-bit file offsets.
********************************************************************/
@@ -175,6 +174,20 @@ ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct
}
/*******************************************************************
+A write wrapper that will deal with EINTR.
+********************************************************************/
+
+ssize_t sys_recv(int fd, void *buf, size_t count, int flags)
+{
+ ssize_t ret;
+
+ do {
+ ret = recv(fd, buf, count, flags);
+ } while (ret == -1 && errno == EINTR);
+ return ret;
+}
+
+/*******************************************************************
A recvfrom wrapper that will deal with EINTR.
********************************************************************/