• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::fd::OwnedFd;
2 use crate::{backend, io, path};
3 
4 pub use backend::fs::types::MemfdFlags;
5 
6 /// `memfd_create(path, flags)`
7 ///
8 /// # References
9 ///  - [Linux]
10 ///
11 /// [Linux]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
12 #[inline]
memfd_create<P: path::Arg>(path: P, flags: MemfdFlags) -> io::Result<OwnedFd>13 pub fn memfd_create<P: path::Arg>(path: P, flags: MemfdFlags) -> io::Result<OwnedFd> {
14     path.into_with_c_str(|path| backend::fs::syscalls::memfd_create(path, flags))
15 }
16