Skip to content

Commit c0935ac

Browse files
author
Bryant Mairs
committed
Add MFD_ constants for memfd_create
1 parent 833e67f commit c0935ac

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ fn main() {
248248
if !uclibc && !musl && !emscripten {
249249
cfg.header("linux/dccp.h");
250250
}
251+
252+
if !musl || mips {
253+
cfg.header("linux/memfd.h");
254+
}
251255
}
252256

253257
if linux {

src/unix/notbsd/android/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,9 @@ pub const IUTF8: ::tcflag_t = 0x00004000;
885885
pub const CMSPAR: ::tcflag_t = 0o10000000000;
886886
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
887887

888+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
889+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
890+
888891
f! {
889892
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
890893
for slot in cpuset.__bits.iter_mut() {

src/unix/notbsd/linux/mips/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@ pub const AF_MAX: ::c_int = 42;
667667
#[doc(hidden)]
668668
pub const PF_MAX: ::c_int = AF_MAX;
669669

670+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
671+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
672+
670673
#[link(name = "util")]
671674
extern {
672675
pub fn sysctl(name: *mut ::c_int,

src/unix/notbsd/linux/musl/b32/mips.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,3 +771,6 @@ pub const SYS_pwritev2: ::c_long = 4000 + 362;
771771
pub const AF_MAX: ::c_int = 42;
772772
#[doc(hidden)]
773773
pub const PF_MAX: ::c_int = AF_MAX;
774+
775+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
776+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;

src/unix/notbsd/linux/other/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ pub const AF_MAX: ::c_int = 42;
548548
#[doc(hidden)]
549549
pub const PF_MAX: ::c_int = AF_MAX;
550550

551+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
552+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
553+
551554
cfg_if! {
552555
if #[cfg(any(target_arch = "arm", target_arch = "x86",
553556
target_arch = "x86_64"))] {

src/unix/notbsd/linux/s390x.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ pub const SYS_setfsuid: ::c_long = 215;
12431243
pub const SYS_setfsgid: ::c_long = 216;
12441244
pub const SYS_newfstatat: ::c_long = 293;
12451245

1246+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
1247+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
1248+
12461249
#[link(name = "util")]
12471250
extern {
12481251
pub fn sysctl(name: *mut ::c_int,

0 commit comments

Comments
 (0)