summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 078b9f7)
raw | patch | inline | side by side (parent: 078b9f7)
author | Vladimir V. Melnikov <wlad.w.m@gmail.com> | |
Mon, 23 Mar 2009 08:22:01 +0000 (09:22 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 23 Mar 2009 08:22:01 +0000 (09:22 +0100) |
Apparently the X/Open conforming `recvmsg' function is in the `xnet'
library. Check for this library and use it if it exists.
Also set the ominous MSG_XPG4_2 flag. Didn't find out what it does, but
apparently it's a Solaris internal flag..
library. Check for this library and use it if it exists.
Also set the ominous MSG_XPG4_2 flag. Didn't find out what it does, but
apparently it's a Solaris internal flag..
configure.ac | patch | blob | history | |
src/liboping.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 5b72c133c6b3dadf05b06e754e2767e03a15e7b7..c6153792d7616d9b5cf175f277837e6a854ef395 100644 (file)
--- a/configure.ac
+++ b/configure.ac
AC_MSG_ERROR(cannot find socket)))
AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
+with_libxnet="no"
+AC_CHECK_LIB(xnet, __xnet_recvmsg, [with_libxnet="yes"],[])
+if test "x$with_libxnet" = "xyes"
+then
+ CFLAGS="$CFLAGS -D_XPG4_2 -D__EXTENSIONS__"
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBXNET, test "x$with_libxnet" = "xyes")
+
nanosleep_needs_rt="no"
AC_CHECK_FUNCS(nanosleep, [],
AC_CHECK_LIB(rt, nanosleep,
diff --git a/src/liboping.c b/src/liboping.c
index 4f7d955a6ad5baab241f46f12d636b0c7df22244..47c8279f2d42e2582439f57a71a90b587542c4d1 100644 (file)
--- a/src/liboping.c
+++ b/src/liboping.c
msghdr.msg_controllen = sizeof (control_buffer);
/* flags; this is an output only field.. */
msghdr.msg_flags = 0;
+#ifdef MSG_XPG4_2
+ msghdr.msg_flags |= MSG_XPG4_2;
+#endif
payload_buffer_len = recvmsg (fd, &msghdr, /* flags = */ 0);
if (payload_buffer_len < 0)