Skip to content

Commit

Permalink
Auto merge of rust-lang#836 - Susurrus:memfd, r=alexcrichton
Browse files Browse the repository at this point in the history
Add constants for memfd_create syscall
  • Loading branch information
bors committed Nov 6, 2017
2 parents 600ea12 + c0935ac commit e38483f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/notbsd/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/notbsd/linux/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/unix/notbsd/linux/musl/b32/mips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 3 additions & 0 deletions src/unix/notbsd/linux/other/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))] {
Expand Down
3 changes: 3 additions & 0 deletions src/unix/notbsd/linux/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e38483f

Please sign in to comment.