diff options
Diffstat (limited to 'vendor/rustix/src/fs/memfd_create.rs')
-rw-r--r-- | vendor/rustix/src/fs/memfd_create.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/rustix/src/fs/memfd_create.rs b/vendor/rustix/src/fs/memfd_create.rs new file mode 100644 index 000000000..74b432739 --- /dev/null +++ b/vendor/rustix/src/fs/memfd_create.rs @@ -0,0 +1,15 @@ +use crate::io::{self, OwnedFd}; +use crate::{imp, path}; + +pub use imp::fs::types::MemfdFlags; + +/// `memfd_create(path, flags)` +/// +/// # References +/// - [Linux] +/// +/// [Linux]: https://man7.org/linux/man-pages/man2/memfd_create.2.html +#[inline] +pub fn memfd_create<P: path::Arg>(path: P, flags: MemfdFlags) -> io::Result<OwnedFd> { + path.into_with_c_str(|path| imp::fs::syscalls::memfd_create(path, flags)) +} |