diff options
author | Jeremy Allison <jra@samba.org> | 2002-04-19 02:15:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-04-19 02:15:12 +0000 |
commit | 17ea08626e8cd14cda64a3c67fdcb6fb700a8380 (patch) | |
tree | 0f266f192a42f8e2012b842ca8669685f78709f6 /source/lib/system.c | |
parent | a1555288253d5d39db0a920ddeb7da9fc2ba0928 (diff) | |
download | samba-17ea08626e8cd14cda64a3c67fdcb6fb700a8380.tar.gz samba-17ea08626e8cd14cda64a3c67fdcb6fb700a8380.tar.xz samba-17ea08626e8cd14cda64a3c67fdcb6fb700a8380.zip |
Fix send and recvfrom.
Jeremy.
Diffstat (limited to 'source/lib/system.c')
-rw-r--r-- | source/lib/system.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/lib/system.c b/source/lib/system.c index 244f4e8a6f9..d7c266f05a6 100644 --- a/source/lib/system.c +++ b/source/lib/system.c @@ -107,7 +107,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; @@ -119,6 +119,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. ********************************************************************/ |