diff --git a/src/vteutils.c b/src/vteutils.c
index 648d185..2dd42d3 100644
--- a/src/vteutils.c
+++ b/src/vteutils.c
@@ -43,6 +43,9 @@
 #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
 #endif
 
+#include <linux/memfd.h>
+#include <sys/syscall.h>
+
 #endif /* __linux__ */
 
 int
@@ -51,6 +54,11 @@ _vte_mkstemp (void)
         int fd;
         gchar *file_name;
 
+        /* TODO: Use proper glibc wrapper, once available */
+        fd = syscall (SYS_memfd_create, "vte", MFD_CLOEXEC);
+        if (fd != -1)
+                goto done;
+
 #ifdef O_TMPFILE
         fd = open (g_get_tmp_dir (),
                    O_TMPFILE | O_EXCL | O_RDWR | O_NOATIME | O_CLOEXEC,
