Skip to content

Commit e3b680d

Browse files
oech3cakebaker
authored andcommitted
baseNM: read ahead
1 parent 9da057e commit e3b680d

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uu/base32/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ doctest = false
2020

2121
[dependencies]
2222
clap = { workspace = true }
23+
rustix = { workspace = true }
2324
uucore = { workspace = true, features = ["encoding"] }
2425
fluent = { workspace = true }
2526

src/uu/base32/src/base_common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ pub fn get_input(config: &Config) -> UResult<Box<dyn BufRead>> {
152152
Some(path_buf) => {
153153
let file =
154154
File::open(path_buf).map_err_context(|| path_buf.maybe_quote().to_string())?;
155+
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd"))]
156+
let _ = rustix::fs::fadvise(&file, 0, None, rustix::fs::Advice::Sequential);
155157
Ok(Box::new(BufReader::with_capacity(DEFAULT_BUF_SIZE, file)))
156158
}
157159
None => {

0 commit comments

Comments
 (0)