diff --git a/Cargo.lock b/Cargo.lock index 1a9269ddcb0..ce852b571cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4339,8 +4339,8 @@ dependencies = [ "clap", "codspeed-divan-compat", "fluent", - "nix", "rustc-hash", + "rustix", "string-interner", "thiserror 2.0.18", "uucore", diff --git a/src/uu/tsort/Cargo.toml b/src/uu/tsort/Cargo.toml index 84a31349643..227cab634ea 100644 --- a/src/uu/tsort/Cargo.toml +++ b/src/uu/tsort/Cargo.toml @@ -28,7 +28,7 @@ uucore = { workspace = true } rustc-hash = { workspace = true } [target.'cfg(unix)'.dependencies] -nix = { workspace = true, features = ["fs"] } +rustix = { workspace = true, features = ["fs"] } [[bin]] name = "tsort" diff --git a/src/uu/tsort/src/tsort.rs b/src/uu/tsort/src/tsort.rs index a689cd05be4..5b2fb66d6d5 100644 --- a/src/uu/tsort/src/tsort.rs +++ b/src/uu/tsort/src/tsort.rs @@ -87,14 +87,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { target_os = "freebsd", ))] { - use nix::fcntl::{PosixFadviseAdvice, posix_fadvise}; + use rustix::fs::{Advice, fadvise}; use std::os::unix::io::AsFd; - posix_fadvise( + fadvise( file.as_fd(), - 0, // offset 0 => from the start of the file - 0, // length 0 => for the whole file - PosixFadviseAdvice::POSIX_FADV_SEQUENTIAL, + 0, // offset 0 => from the start of the file + None, // None => for the whole file + Advice::Sequential, ) .ok(); }