diff --git a/Cargo.toml b/Cargo.toml index bfacfeb95..5df8f4140 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,7 +170,7 @@ stdio = [] # Enable `rustix::system::*`. system = ["linux-raw-sys/system"] -# Enable `rustix::runtime::*`. ⚠ This API is undocumented and unstable and +# Enable `rustix::runtime_*::*`. ⚠ This API is undocumented and unstable and # experimental and not intended for general-purpose use. ⚠ runtime = ["linux-raw-sys/prctl"] diff --git a/src/lib.rs b/src/lib.rs index 8d4a5e521..6d0c12f30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -309,12 +309,21 @@ pub mod thread; pub mod time; // "runtime" is also a public API module, but it's only for libc-like users. +// +// People have been observed using it in the wild, so as a counter-measure, +// it now has a name mangled with a random string that will rotate periodically. +#[cfg(not(windows))] +#[cfg(feature = "runtime")] +#[cfg(linux_raw)] +#[cfg_attr(not(document_experimental_runtime_api), doc(hidden))] +#[cfg_attr(docsrs, doc(cfg(feature = "runtime")))] +pub mod runtime_448b8ad740e2a26f; #[cfg(not(windows))] #[cfg(feature = "runtime")] #[cfg(linux_raw)] #[cfg_attr(not(document_experimental_runtime_api), doc(hidden))] #[cfg_attr(docsrs, doc(cfg(feature = "runtime")))] -pub mod runtime; +pub(crate) use runtime_448b8ad740e2a26f as runtime; // Declare "fs" as a non-public module if "fs" isn't enabled but we need it for // reading procfs. diff --git a/src/runtime.rs b/src/runtime_448b8ad740e2a26f.rs similarity index 100% rename from src/runtime.rs rename to src/runtime_448b8ad740e2a26f.rs