diff options
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r-- | source3/lib/system.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index d97751eb4b..61f93dd6a5 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -106,7 +106,7 @@ ssize_t sys_write(int fd, const void *buf, size_t count) A send wrapper that will deal with EINTR. ********************************************************************/ -int sys_send(int s, const void *msg, size_t len, int flags) +ssize_t sys_send(int s, const void *msg, size_t len, int flags) { ssize_t ret; @@ -118,6 +118,21 @@ int sys_send(int s, const void *msg, size_t len, int flags) } /******************************************************************* +A recvfrom wrapper that will deal with EINTR. +********************************************************************/ + +ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen) +{ + ssize_t ret; + + do { + errno = 0; + ret = recvfrom(s, buf, len, flags, from, fromlen); + } while (ret == -1 && errno == EINTR); + return ret; +} + +/******************************************************************* A stat() wrapper that will deal with 64 bit filesizes. ********************************************************************/ |