]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
* [Bug 737] Some systems need help providing struct iovec.
authorHarlan Stenn <stenn@ntp.org>
Sun, 19 Nov 2006 05:12:41 +0000 (21:12 -0800)
committerHarlan Stenn <stenn@ntp.org>
Sun, 19 Nov 2006 05:12:41 +0000 (21:12 -0800)
bk: 455fe7c98Qk3c6-DBscYjqn57ye2SQ

NEWS
configure.ac
ntpd/ntp_io.c

diff --git a/NEWS b/NEWS
index a813974454f2b467b6fa97f7f021820a8839d6e6..d813f12555edd1830948c2cc98445681f25b6078 100644 (file)
--- 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.
index 75244c010d011476406caba1295d753261fbe919..afe47444363ed32869892d5ff36892568eff318a 100644 (file)
@@ -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 <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if $ac_cv_struct_iovec_help
+#include <sys/uio.h>
+#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*])
index 58aca6ab9d0ebc611d020f7e220680ab1e00cb3a..fad74c7a2223243acea80bfd9eb79ca05735aa90 100644 (file)
@@ -38,6 +38,9 @@
 #ifdef HAVE_SYS_SOCKIO_H       /* UXPV: SIOC* #defines (Frank Vance <fvance@waii.com>) */
 # include <sys/sockio.h>
 #endif
+#ifdef HAVE_SYS_UIO_H
+# include <sys/uio.h>
+#endif
 
 /*
  * setsockopt does not always have the same arg declaration