mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
baseNM: read ahead
This commit is contained in:
Generated
+1
@@ -3214,6 +3214,7 @@ version = "0.9.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"fluent",
|
||||
"rustix",
|
||||
"uucore",
|
||||
]
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ doctest = false
|
||||
|
||||
[dependencies]
|
||||
clap = { workspace = true }
|
||||
rustix = { workspace = true }
|
||||
uucore = { workspace = true, features = ["encoding"] }
|
||||
fluent = { workspace = true }
|
||||
|
||||
|
||||
@@ -152,6 +152,8 @@ pub fn get_input(config: &Config) -> UResult<Box<dyn BufRead>> {
|
||||
Some(path_buf) => {
|
||||
let file =
|
||||
File::open(path_buf).map_err_context(|| path_buf.maybe_quote().to_string())?;
|
||||
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
|
||||
let _ = rustix::fs::fadvise(&file, 0, None, rustix::fs::Advice::Sequential);
|
||||
Ok(Box::new(BufReader::with_capacity(DEFAULT_BUF_SIZE, file)))
|
||||
}
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user