Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't enable the "fs" module implicitly. #1175

Closed
wants to merge 2 commits into from
Closed
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
15 changes: 1 addition & 14 deletions src/backend/linux_raw/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@ pub(crate) use linux_raw_sys::general::{
#[cfg(test)]
pub(crate) use linux_raw_sys::general::epoll_event;

#[cfg(any(
feature = "fs",
all(
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
#[cfg(feature = "fs")]
pub(crate) use linux_raw_sys::general::{
AT_FDCWD, NFS_SUPER_MAGIC, O_LARGEFILE, PROC_SUPER_MAGIC, UTIME_NOW, UTIME_OMIT, XATTR_CREATE,
XATTR_REPLACE,
Expand Down
15 changes: 1 addition & 14 deletions src/backend/linux_raw/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,20 +296,7 @@ pub(super) fn socklen_t<'a, Num: ArgNumber>(i: socklen_t) -> ArgReg<'a, Num> {
pass_usize(i as usize)
}

#[cfg(any(
feature = "fs",
all(
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
#[cfg(feature = "fs")]
pub(crate) mod fs {
use super::*;
use crate::fs::{FileType, Mode, OFlags};
Expand Down
31 changes: 2 additions & 29 deletions src/backend/linux_raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,7 @@ mod vdso_wrappers;

#[cfg(feature = "event")]
pub(crate) mod event;
#[cfg(any(
feature = "fs",
all(
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
#[cfg(feature = "fs")]
pub(crate) mod fs;
pub(crate) mod io;
#[cfg(feature = "io_uring")]
Expand Down Expand Up @@ -93,21 +80,7 @@ pub(crate) mod c;
pub(crate) mod pid;
#[cfg(any(feature = "process", feature = "thread"))]
pub(crate) mod prctl;
#[cfg(any(
feature = "fs",
feature = "process",
feature = "thread",
all(
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
#[cfg(any(feature = "fs", feature = "process", feature = "thread"))]
pub(crate) mod ugid;

/// The maximum number of buffers that can be passed into a vectored I/O system
Expand Down
65 changes: 0 additions & 65 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,48 +292,6 @@ pub mod time;
#[cfg_attr(docsrs, doc(cfg(feature = "runtime")))]
pub mod runtime;

// Temporarily provide some mount functions for use in the fs module for
// backwards compatibility.
#[cfg(linux_kernel)]
#[cfg(all(feature = "fs", not(feature = "mount")))]
pub(crate) mod mount;

// Declare "fs" as a non-public module if "fs" isn't enabled but we need it for
// reading procfs.
#[cfg(not(windows))]
#[cfg(not(feature = "fs"))]
#[cfg(all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
))]
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
pub(crate) mod fs;

// Similarly, declare `path` as a non-public module if needed.
#[cfg(not(windows))]
#[cfg(not(any(feature = "fs", feature = "mount", feature = "net")))]
#[cfg(all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
))]
pub(crate) mod path;

// Private modules used by multiple public modules.
#[cfg(not(any(windows, target_os = "espidf")))]
#[cfg(any(feature = "thread", feature = "time", target_arch = "x86"))]
Expand Down Expand Up @@ -362,36 +320,13 @@ mod signal;
feature = "runtime",
feature = "thread",
feature = "time",
all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "process",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
)
))]
mod timespec;
#[cfg(not(any(windows, target_os = "wasi")))]
#[cfg(any(
feature = "fs",
feature = "process",
feature = "thread",
all(
linux_raw,
not(feature = "use-libc-auxv"),
not(feature = "use-explicitly-provided-auxv"),
any(
feature = "param",
feature = "runtime",
feature = "time",
target_arch = "x86",
)
),
all(linux_kernel, feature = "net")
))]
mod ugid;
Loading