1 From: Ian Jackson <ijackson@chiark.greenend.org.uk>
2 Date: Fri, 5 Oct 2018 22:43:34 +0100
3 Subject: configure.ac: memshr_create: Detect and use from <sys/mman.h>
5 Recent glibc versions do have a wrapper for this function. It is available via
7 * Add <sys/mman.h> to the list of header checks.
8 * Add a conditional include of <sys/mman.h> to the configure test
9 for memshr_create, so that it will pass if the function is there.
10 * Add the same conditional include to missing.h, so that we
11 get it declared when we build.
13 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
16 src/basic/missing.h | 4 ++++
17 2 files changed, 8 insertions(+)
19 diff --git a/configure.ac b/configure.ac
20 index c0ad243..9ec3390 100644
23 @@ -358,6 +358,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
24 # ------------------------------------------------------------------------------
26 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
27 +AC_CHECK_HEADERS([sys/mman.h], [], [])
28 AC_CHECK_HEADERS([linux/memfd.h], [], [])
29 AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
31 @@ -399,6 +400,9 @@ AC_CHECK_DECLS([
34 #include <linux/loop.h>
35 +#ifdef HAVE_SYS_MMAN_H
36 +#include <sys/mman.h>
40 AC_CHECK_DECLS([getrandom],
41 diff --git a/src/basic/missing.h b/src/basic/missing.h
42 index c62c2db..e8508e7 100644
43 --- a/src/basic/missing.h
44 +++ b/src/basic/missing.h
46 #include <linux/btrfs.h>
49 +#ifdef HAVE_SYS_MMAN_H
50 +#include <sys/mman.h>
53 #ifdef HAVE_LINUX_VM_SOCKETS_H
54 #include <linux/vm_sockets.h>