From: Harlan Stenn Date: Sun, 19 Nov 2006 05:12:41 +0000 (-0800) Subject: * [Bug 737] Some systems need help providing struct iovec. X-Git-Tag: NTP_4_2_3P66_RC~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1af0c6c155c95809bed128f11479310754ad59c;p=thirdparty%2Fntp.git * [Bug 737] Some systems need help providing struct iovec. bk: 455fe7c98Qk3c6-DBscYjqn57ye2SQ --- diff --git a/NEWS b/NEWS index a81397445..d813f1255 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* [Bug 737] Some systems need help providing struct iovec. * [Bug 717] Fix libopts compile problem. * [Bug 728] parse documentation fixes. * [Bug 734] setsockopt(..., IP_MULTICAST_IF, ...) fails on 64-bit platforms. diff --git a/configure.ac b/configure.ac index 75244c010..afe474443 100644 --- a/configure.ac +++ b/configure.ac @@ -1218,6 +1218,50 @@ case "$host" in esac AC_CHECK_FUNCS(uname updwtmp updwtmpx vsnprintf vsprintf) +### + +# http://bugs.ntp.isc.org/737 +case "$ac_cv_func_recvmsg" in + yes) + AC_MSG_CHECKING([if we need extra help to define struct iovec]) + AC_CACHE_VAL(ac_cv_struct_iovec_help,dnl + [for ac_cv_struct_iovec_help in '0' '1'; do + AC_TRY_COMPILE(dnl +[#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#if $ac_cv_struct_iovec_help +#include +#endif + +void foo(); +void foo() { + ssize_t x; + int s = 0; + struct iovec iov; + struct msghdr mh; + int flags = 0; + + mh.msg_iov = &iov; + x = recvmsg(s, &mh, flags); +}],,dnl + [ac_worked=yes ; break 1], ac_worked=no) + done +])dnl AC_CACHE_VAL + case "$ac_worked$ac_cv_struct_iovec_help" in + yes1) + AC_DEFINE(HAVE_SYS_UIO_H, 1, [Use sys/uio.h for struct iovec help]) + ans=yes + ;; + *) ans=no + esac + AC_MSG_RESULT([$ans]) + ;; +esac + case "$host" in *-*-sunos4*) AC_DEFINE(SPRINTF_CHAR, 1, [*s*printf() functions are char*]) diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 58aca6ab9..fad74c7a2 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -38,6 +38,9 @@ #ifdef HAVE_SYS_SOCKIO_H /* UXPV: SIOC* #defines (Frank Vance ) */ # include #endif +#ifdef HAVE_SYS_UIO_H +# include +#endif /* * setsockopt does not always have the same arg declaration