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
Closed

Consider implementing AsRawFd for Stdout, Stdin and Stderr #40007

malbarbo opened this issue Feb 21, 2017 · 6 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@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
Copy link
Member

nagisa commented Feb 21, 2017

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

@nagisa
Copy link
Member

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
Copy link
Contributor Author

@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
Copy link
Member

nagisa commented Feb 21, 2017

It’s private API to libstd.

@codyps
Copy link
Contributor

codyps commented Feb 21, 2017

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

@Mark-Simulacrum Mark-Simulacrum added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 24, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-feature-request Category: A feature request, i.e: not implemented / a PR. label Jul 27, 2017
@alexcrichton
Copy link
Member

Done in #43459!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants