Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/backend/libc/fs/syscalls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1868,16 +1868,26 @@ pub(crate) fn memfd_create(name: &CStr, flags: MemfdFlags) -> io::Result<OwnedFd
unsafe { ret_owned_fd(memfd_create(c_str(name), bitflags_bits!(flags))) }
}

#[cfg(linux_raw_dep)]
#[cfg(linux_kernel)]
pub(crate) fn openat2(
dirfd: BorrowedFd<'_>,
path: &CStr,
oflags: OFlags,
mode: Mode,
resolve: ResolveFlags,
) -> io::Result<OwnedFd> {
#[cfg(linux_raw_dep)]
use linux_raw_sys::general::open_how;

#[cfg(not(linux_raw_dep))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
struct open_how {
flags: u64,
mode: u64,
resolve: u64,
}

syscall! {
fn openat2(
base_dirfd: c::c_int,
Expand Down
4 changes: 2 additions & 2 deletions src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod ioctl;
mod makedev;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
mod memfd_create;
#[cfg(linux_raw_dep)]
#[cfg(linux_kernel)]
mod openat2;
#[cfg(linux_kernel)]
mod raw_dir;
Expand Down Expand Up @@ -112,7 +112,7 @@ pub use ioctl::*;
pub use makedev::*;
#[cfg(any(linux_kernel, target_os = "freebsd"))]
pub use memfd_create::memfd_create;
#[cfg(linux_raw_dep)]
#[cfg(linux_kernel)]
pub use openat2::openat2;
#[cfg(linux_kernel)]
pub use raw_dir::{RawDir, RawDirEntry};
Expand Down
2 changes: 1 addition & 1 deletion tests/fs/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod mknodat;
mod negative_timestamp;
#[cfg(linux_kernel)]
mod openat;
#[cfg(linux_raw_dep)]
#[cfg(linux_kernel)]
mod openat2;
#[cfg(not(target_os = "redox"))]
mod readdir;
Expand Down
Loading