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

Consider implementing AsRawFd for Stdout, Stdin and Stderr #40007

Closed
malbarbo opened this Issue Feb 21, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@malbarbo
Copy link
Contributor

malbarbo commented Feb 21, 2017

No description provided.

@malbarbo malbarbo changed the title Considerer implementing AsRawFd for Stdout, Stdin and Stderr Consider implementing AsRawFd for Stdout, Stdin and Stderr Feb 21, 2017

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Feb 21, 2017

This cannot happen, because Stdout and Stderr may be replaced by arbitrary instance of Write internally.

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Feb 21, 2017

Although if all the platforms Rust runs on support something along the lines of memfd (not true, as we support linux 2.6.xx, whereas memfd is 3.17+), then it may be feasible.

@malbarbo

This comment has been minimized.

Copy link
Contributor Author

malbarbo commented Feb 21, 2017

@nagisa

This cannot happen, because Stdout and Stderr may be replaced by arbitrary instance of Write internally.

How can Stdout be replaced by an arbitrary instance?

Note that the trait AsRawFd is an extension trait defined in some platforms, like unix, in platforms that does not define AsRawFd trait or does not have a reasonable implementation of AsRawFd for Stdout, the implementation would be missing.

@nagisa

This comment has been minimized.

Copy link
Contributor

nagisa commented Feb 21, 2017

It’s private API to libstd.

@jmesmon

This comment has been minimized.

Copy link
Contributor

jmesmon commented Feb 21, 2017

Due to the Send bound, it seems like one only needs threads + pipes to implement AsRawFd for these types.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 9, 2017

Done in #43459!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.