summaryrefslogtreecommitdiff
path: root/src/shared/memfd.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-05 18:41:31 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-05 19:07:28 -0400
commit27c64db6dff88ebe9761dfe3b0c073d2a9bf2e41 (patch)
treec00b668d9d4672a04eb2a2634d4d439687dc0a91 /src/shared/memfd.c
parent0077776275cb753e478e0f92d4065dec5276c44a (diff)
build-sys: use linux/memfd.h if available
linux/memfd.h was added linux 3.17, so it might not be widely available for a while. Also, check if memfd_create is defined, for the HAVE_LINUX_MEMFD_H check to have a chance of succeeding. Also, collapse all ifdefs for memfd-related stuff, because they were all added together so there's no need to check separately.
Diffstat (limited to 'src/shared/memfd.c')
-rw-r--r--src/shared/memfd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/memfd.c b/src/shared/memfd.c
index 1feca0c979..162c12f7a7 100644
--- a/src/shared/memfd.c
+++ b/src/shared/memfd.c
@@ -25,11 +25,15 @@
#include <sys/mman.h>
#include <sys/prctl.h>
+#ifdef HAVE_LINUX_MEMFD_H
+# include <linux/memfd.h>
+#endif
+
#include "util.h"
#include "bus-label.h"
-#include "missing.h"
#include "memfd.h"
#include "utf8.h"
+#include "missing.h"
int memfd_new(const char *name) {
_cleanup_free_ char *g = NULL;