--- systemd-234-lunar/configure.ac	2017-07-12 16:01:10.000000000 +0200
+++ systemd-234/configure.ac	2018-02-23 17:41:06.356666663 +0100
@@ -311,6 +311,12 @@
 AC_CHECK_HEADERS([linux/memfd.h], [], [])
 AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
 
+AS_IF([test "x$enable_memfd" != "xno"],
+    AC_CHECK_FUNC(memfd_create, [HAVE_MEMFD_CREATE=1], [HAVE_MEMFD_CREATE=0], [#include <sys/mman.h>]),
+    [HAVE_MEMFD_CREATE=0])
+AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$HAVE_MEMFD_CREATE" = x1])
+AS_IF([test "x$HAVE_MEMFD_CREATE" = "x1"], AC_DEFINE([HAVE_MEMFD_CREATE], 1, [Define to 1 if you have the `memfd_create` function.]))
+
 # unconditionally pull-in librt with old glibc versions
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
 
--- systemd-234-lunar/src/basic/missing_syscall.h	2017-07-12 16:01:10.000000000 +0200
+++ systemd-234/src/basic/missing_syscall.h	2018-02-23 17:25:27.606666663 +0100
@@ -30,7 +30,7 @@
 
 /* ======================================================================= */
 
-#if !HAVE_DECL_MEMFD_CREATE
+#ifndef HAVE_MEMFD_CREATE
 #  ifndef __NR_memfd_create
 #    if defined __x86_64__
 #      define __NR_memfd_create 319
--- systemd-234-lunar/src/basic/fileio.c	2017-07-12 16:01:10.000000000 +0200
+++ systemd-234/src/basic/fileio.c	2018-02-23 17:30:56.683333332 +0100
@@ -24,6 +24,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
