From 6239146e931fd3127f6994975a56d1b4884a708a Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sun, 16 Feb 2014 11:03:22 +0100 Subject: warnless: add wrapper function for read and write on Windows --- lib/warnless.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/warnless.c') diff --git a/lib/warnless.c b/lib/warnless.c index 7a4b01eb6..c14d05f09 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -400,6 +400,20 @@ curl_socket_t curlx_sitosk(int i) #endif /* USE_WINSOCK */ +#if defined(WIN32) || defined(_WIN32) + +ssize_t curlx_read(int fd, void *buf, size_t count) +{ + return (ssize_t)read(fd, buf, curlx_uztoui(count)); +} + +ssize_t curlx_write(int fd, const void *buf, size_t count) +{ + return (ssize_t)write(fd, buf, curlx_uztoui(count)); +} + +#endif /* WIN32 || _WIN32 */ + #if defined(__INTEL_COMPILER) && defined(__unix__) int curlx_FD_ISSET(int fd, fd_set *fdset) -- cgit v1.2.3