diff --git a/libc-test/build.rs b/libc-test/build.rs
index 5212697dfe510204c3caa910a1224748003a89c9..3bf0eb6f0ab344f2f53aff2a6bf0af57d4297ad6 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -248,6 +248,10 @@ fn main() {
         if !uclibc && !musl && !emscripten {
             cfg.header("linux/dccp.h");
         }
+
+        if !musl || mips {
+            cfg.header("linux/memfd.h");
+        }
     }
 
     if linux {
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 7ade5de366b67eff9c9984937401ec891dc13637..a47a8629867cd14392f1c3955af74d1b4c4857d7 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -885,6 +885,9 @@ pub const IUTF8: ::tcflag_t = 0x00004000;
 pub const CMSPAR: ::tcflag_t = 0o10000000000;
 pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
 
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
 f! {
     pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
         for slot in cpuset.__bits.iter_mut() {
diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs
index a94e2bcddbea29b2e3b2ca28cfb85bd8120258f8..197d48eb923e1bbdb0827ec0cac81d13bcbc6177 100644
--- a/src/unix/notbsd/linux/mips/mod.rs
+++ b/src/unix/notbsd/linux/mips/mod.rs
@@ -667,6 +667,9 @@ pub const AF_MAX: ::c_int = 42;
 #[doc(hidden)]
 pub const PF_MAX: ::c_int = AF_MAX;
 
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
 #[link(name = "util")]
 extern {
     pub fn sysctl(name: *mut ::c_int,
diff --git a/src/unix/notbsd/linux/musl/b32/mips.rs b/src/unix/notbsd/linux/musl/b32/mips.rs
index 89231a0c75165d98da4b7d2f7b5864904107dc36..7c9853753cb783c385f205251b79b21373a7552f 100644
--- a/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -771,3 +771,6 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362;
 pub const AF_MAX: ::c_int = 42;
 #[doc(hidden)]
 pub const PF_MAX: ::c_int = AF_MAX;
+
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index ad54ecf571bb2776bb494f6d992cbe12e475f22c..cba0f56f3704055300e745aefd7fbc16f6721234 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -548,6 +548,9 @@ pub const AF_MAX: ::c_int = 42;
 #[doc(hidden)]
 pub const PF_MAX: ::c_int = AF_MAX;
 
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
 cfg_if! {
     if #[cfg(any(target_arch = "arm", target_arch = "x86",
                  target_arch = "x86_64"))] {
diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs
index aef8825994f8d363a4585aa9e29ab9007e2e9421..8927c9d7e456d9e9fca9c0eceacc408c90d4d823 100644
--- a/src/unix/notbsd/linux/s390x.rs
+++ b/src/unix/notbsd/linux/s390x.rs
@@ -1243,6 +1243,9 @@ pub const SYS_setfsuid: ::c_long = 215;
 pub const SYS_setfsgid: ::c_long = 216;
 pub const SYS_newfstatat: ::c_long = 293;
 
+pub const MFD_CLOEXEC: ::c_uint = 0x0001;
+pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
+
 #[link(name = "util")]
 extern {
     pub fn sysctl(name: *mut ::c_int,