chiark / gitweb /
configure.ac: memshr_create: Detect and use from <sys/mman.h>
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Oct 2018 21:43:34 +0000 (22:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Oct 2018 22:00:41 +0000 (23:00 +0100)
Recent glibc versions do have a wrapper for this function.  It is available via
<sys/mman.h>.  So:
  * Add <sys/mman.h> to the list of header checks.
  * Add a conditional include of <sys/mman.h> to the configure test
    for memshr_create, so that it will pass if the function is there.
  * Add the same conditional include to missing.h, so that we
    get it declared when we build.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
configure.ac
src/basic/missing.h

index c0ad243d249a6aa0cad67764958913f7c877c222..9ec3390ff43042cd69e2bbcbfc9a99c4af651270 100644 (file)
@@ -358,6 +358,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
 # ------------------------------------------------------------------------------
 
 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
+AC_CHECK_HEADERS([sys/mman.h], [], [])
 AC_CHECK_HEADERS([linux/memfd.h], [], [])
 AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
 
@@ -399,6 +400,9 @@ AC_CHECK_DECLS([
 #include <sched.h>
 #include <string.h>
 #include <linux/loop.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
 ]])
 
 AC_CHECK_DECLS([getrandom],
index c62c2db1cb122c8df238d81ba07e89aa4eff3224..e8508e7705d4e2de19d1643d7a3f7abfff777402 100644 (file)
 #include <linux/btrfs.h>
 #endif
 
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
 #ifdef HAVE_LINUX_VM_SOCKETS_H
 #include <linux/vm_sockets.h>
 #else