-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
uucore::pipes: remove pipe and use pipe_with_size(MAX_ROOTLESS_PIPE_SIZE) #12284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ pub fn pipe() -> std::io::Result<(File, File)> { | |
| /// useful to save RAM usage | ||
| #[inline] | ||
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||
| fn pipe_with_size(s: usize) -> std::io::Result<(File, File)> { | ||
| pub fn pipe_with_size(s: usize) -> std::io::Result<(File, File)> { | ||
| let (read, write) = rustix::pipe::pipe()?; | ||
| if s > KERNEL_DEFAULT_PIPE_SIZE { | ||
| let _ = fcntl_setpipe_size(&read, s); | ||
|
Comment on lines
+43
to
46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error is deliberately ignored since it is NOT requirement for splice fast-path. I'll add different |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -687,13 +687,13 @@ fn test_output_lossy_utf8() { | |
| #[cfg_attr(wasi_runner, ignore = "WASI sandbox: host paths not visible")] | ||
| fn test_comm_anonymous_pipes() { | ||
| use std::{io::Write, os::fd::AsRawFd, process}; | ||
| use uucore::pipes::pipe; | ||
| use uucore::pipes::{pipe_with_size, MAX_ROOTLESS_PIPE_SIZE}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And cfg should be gated to unix too. |
||
|
|
||
| let scene = TestScenario::new(util_name!()); | ||
|
|
||
| // Open two anonymous pipes | ||
| let (comm1_reader, mut comm1_writer) = pipe().unwrap(); | ||
| let (comm2_reader, mut comm2_writer) = pipe().unwrap(); | ||
| let (comm1_reader, mut comm1_writer) = pipe_with_size(MAX_ROOTLESS_PIPE_SIZE).unwrap(); | ||
| let (comm2_reader, mut comm2_writer) = pipe_with_size(MAX_ROOTLESS_PIPE_SIZE).unwrap(); | ||
|
|
||
| // comm reads the data in chunks | ||
| // make content large enough, so that at least two chunks are read | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal is blocked by #12284 (comment) .