[systemd-devel] [PATCH] buildsys, missing: include linux/memfd.h if found

Cristian Rodríguez crrodriguez at opensuse.org
Tue Sep 16 15:10:41 PDT 2014


That's in order to get the system 's definitions of memfd API flags
instead of relying on the locally defined ones.
---
 configure.ac         | 1 +
 src/shared/missing.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index fb16904..5ebe6ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -283,6 +283,7 @@ AM_CONDITIONAL([HAVE_PYTHON_DEVEL], [test "$have_python_devel" = "yes"])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
 AC_CHECK_HEADERS([linux/btrfs.h], [], [])
+AC_CHECK_HEADERS_ONCE([linux/memfd.h])
 
 # unconditionally pull-in librt with old glibc versions
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
diff --git a/src/shared/missing.h b/src/shared/missing.h
index b441149..9da6e71 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -45,6 +45,10 @@
 #include <asm/sgidefs.h>
 #endif
 
+#ifdef HAVE_LINUX_MEMFD_H
+#include <linux/memfd.h>
+#endif
+
 #ifndef RLIMIT_RTTIME
 #define RLIMIT_RTTIME 15
 #endif
-- 
2.1.0



More information about the systemd-devel mailing list