From adf1196e3ffe6b5ce45d2eed7549dffe7770f766 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 24 Sep 2008 08:43:05 +0200 Subject: [PATCH] make sycls.c compile on Solaris where struct msghdr.msg_control e.a. do not exist --- sycls.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sycls.c b/sycls.c index f9b4244..35dab59 100644 --- a/sycls.c +++ b/sycls.c @@ -1065,15 +1065,28 @@ int Recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, int Recvmsg(int s, struct msghdr *msgh, int flags) { int retval, _errno; char infobuff[256]; +#if defined(HAVE_STRUCT_MSGHDR_MSGCONTROL) && defined(HAVE_STRUCT_MSGHDR_MSGCONTROLLEN) && defined(HAVE_STRUCT_MSGHDR_MSGFLAGS) Debug10("recvmsg(%d, %p{%p,%u,%p,%u,%p,%u,%d}, %d)", s, msgh, msgh->msg_name, msgh->msg_namelen, msgh->msg_iov, msgh->msg_iovlen, msgh->msg_control, msgh->msg_controllen, msgh->msg_flags, flags); +#else + Debug7("recvmsg(%d, %p{%p,%u,%p,%u}, %d)", s, msgh, + msgh->msg_name, msgh->msg_namelen, msgh->msg_iov, msgh->msg_iovlen, + flags); +#endif retval = recvmsg(s, msgh, flags); _errno = errno; +#if defined(HAVE_STRUCT_MSGHDR_MSGCONTROLLEN) Debug5("recvmsg(, {%s,%u,,%u,,%u,}, ) -> %d", msgh->msg_name?sockaddr_info(msgh->msg_name, msgh->msg_namelen, infobuff, sizeof(infobuff)):"NULL", msgh->msg_namelen, msgh->msg_iovlen, msgh->msg_controllen, retval); +#else + Debug4("recvmsg(, {%s,%u,,%u,,}, ) -> %d", + msgh->msg_name?sockaddr_info(msgh->msg_name, msgh->msg_namelen, infobuff, sizeof(infobuff)):"NULL", + msgh->msg_namelen, msgh->msg_iovlen, + retval); +#endif errno = _errno; return retval; }