diff options
Diffstat (limited to 'src/assuan-io-pth.c')
-rw-r--r-- | src/assuan-io-pth.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/assuan-io-pth.c b/src/assuan-io-pth.c index 13f8794..53840e5 100644 --- a/src/assuan-io-pth.c +++ b/src/assuan-io-pth.c @@ -25,8 +25,9 @@ #include <sys/time.h> #include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> -#include <sys/wait.h> +#endif #if HAVE_SYS_UIO_H # include <sys/uio.h> #endif @@ -55,26 +56,22 @@ _assuan_waitpid (pid_t pid, int *status, int options) ssize_t _assuan_simple_read (assuan_context_t ctx, void *buffer, size_t size) { -#ifndef HAVE_W32_SYSTEM return pth_read (ctx->inbound.fd, buffer, size); -#else - return recv (ctx->inbound.fd, buffer, size, 0); -#endif } ssize_t _assuan_simple_write (assuan_context_t ctx, const void *buffer, size_t size) { -#ifndef HAVE_W32_SYSTEM return pth_write (ctx->outbound.fd, buffer, size); -#else - return send (ctx->outbound.fd, buffer, size, 0); -#endif } - +#ifdef _WIN32 +int +_assuan_simple_sendmsg (assuan_context_t ctx, void *msg) +#else ssize_t _assuan_simple_sendmsg (assuan_context_t ctx, struct msghdr *msg) +#endif { #if defined(HAVE_W32_SYSTEM) return _assuan_error (ASSUAN_Not_Implemented); @@ -109,9 +106,13 @@ _assuan_simple_sendmsg (assuan_context_t ctx, struct msghdr *msg) #endif } - +#ifdef _WIN32 +int +_assuan_simple_recvmsg (assuan_context_t ctx, void *msg) +#else ssize_t _assuan_simple_recvmsg (assuan_context_t ctx, struct msghdr *msg) +#endif { #if defined(HAVE_W32_SYSTEM) return _assuan_error (ASSUAN_Not_Implemented); |