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