From 2f146ec68344c4bc11e1a9d174bdf548e1a22d5a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 5 Oct 2006 12:33:59 +0000 Subject: r19101: add sys_recv() wrapper metze --- source/lib/system.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/lib/system.c') diff --git a/source/lib/system.c b/source/lib/system.c index 42f9615c9e4..d92262a786d 100644 --- a/source/lib/system.c +++ b/source/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. ********************************************************************/ @@ -174,6 +173,20 @@ ssize_t sys_sendto(int s, const void *msg, size_t len, int flags, const struct return ret; } +/******************************************************************* +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. ********************************************************************/ -- cgit