Skip to content

Commit da3a471

Browse files
committed
cat: remove fcntl()
1 parent cfa92db commit da3a471

2 files changed

Lines changed: 0 additions & 5 deletions

File tree

src/uu/cat/src/splice.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ pub(super) fn write_fast_using_splice<R: FdReadable, S: AsRawFd + AsFd>(
2424
write_fd: &S,
2525
) -> CatResult<bool> {
2626
if splice(&handle.reader, &write_fd, MAX_ROOTLESS_PIPE_SIZE).is_ok() {
27-
// fcntl improves throughput
28-
// todo: avoid fcntl overhead for small input, but don't fcntl inside of the loop
29-
let _ = rustix::pipe::fcntl_setpipe_size(write_fd, MAX_ROOTLESS_PIPE_SIZE);
3027
loop {
3128
match splice(&handle.reader, &write_fd, MAX_ROOTLESS_PIPE_SIZE) {
3229
Ok(1..) => {}

src/uucore/src/lib/features/pipes.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ pub const MAX_ROOTLESS_PIPE_SIZE: usize = 1024 * 1024;
2222
#[cfg(any(target_os = "linux", target_os = "android"))]
2323
pub fn pipe() -> std::io::Result<(File, File)> {
2424
let (read, write) = rustix::pipe::pipe()?;
25-
// improve performance for splice
26-
let _ = fcntl_setpipe_size(&read, MAX_ROOTLESS_PIPE_SIZE);
2725

2826
Ok((File::from(read), File::from(write)))
2927
}

0 commit comments

Comments
 (0)