Skip to content

Commit e0f0b52

Browse files
SusurrusBryant Mairs
authored andcommitted
add memfd
1 parent 833e67f commit e0f0b52

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ fn main() {
221221
cfg.header("sys/personality.h");
222222
cfg.header("sys/swap.h");
223223
cfg.header("pty.h");
224+
cfg.header("linux/memfd.h");
224225
if !uclibc {
225226
cfg.header("sys/sysinfo.h");
226227
}

src/unix/notbsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,9 @@ pub const POLLNVAL: ::c_short = 0x20;
803803
pub const POLLRDNORM: ::c_short = 0x040;
804804
pub const POLLRDBAND: ::c_short = 0x080;
805805

806+
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
807+
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
808+
806809
f! {
807810
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
808811
let fd = fd as usize;
@@ -992,6 +995,7 @@ extern {
992995
pub fn fexecve(fd: ::c_int, argv: *const *const ::c_char,
993996
envp: *const *const ::c_char)
994997
-> ::c_int;
998+
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
995999
}
9961000

9971001
cfg_if! {

0 commit comments

Comments
 (0)