Skip to content
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

does os_pipe support for tokio::io::copy? #35

Closed
ningmingxiao opened this issue Oct 8, 2024 · 2 comments · May be fixed by containerd/rust-extensions#326
Closed

does os_pipe support for tokio::io::copy? #35

ningmingxiao opened this issue Oct 8, 2024 · 2 comments · May be fixed by containerd/rust-extensions#326

Comments

@ningmingxiao
Copy link

we often meet io::copy hang if fd is closed on write side.

@oconnor663
Copy link
Owner

oconnor663 commented Oct 8, 2024

No, this crate isn't intended to work with async IO. You could probably make it work on Unix by calling libc::fcntl with O_NONBLOCK after creating the pipe, but I haven't tried it. (And if you're going to get that low-level/platform-specific, then this crate isn't really doing much for you, and it might make more sense to call libc::pipe2 yourself instead.) There's a comment in the Rust standard library that discusses why these pipes cannot work with async IO on Windows ("IOCP").

@ningmingxiao
Copy link
Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants