-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Indicate how ChildStd{in,out,err} FDs are closed. #44625
Conversation
src/libstd/process.rs
Outdated
/// | ||
/// This struct is used in the [`stdin`] field on [`Child`]. | ||
/// | ||
/// When an instance of `ChildStdin` is [dropped], the `ChildStdin`'s underlying | ||
/// operating system file descriptor will be closed. |
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.
'underlying operating system file descriptor' is a mouthful. very open to other terminology here.
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.
"file handle", maybe? that's just trading one OS's terminology for another's
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.
i'm 🆒 with 'file handle'. do you think "underlying operating system file handle" or "underlying file handle" or "file handle" or something else?
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.
"underlying file handle" was what i had in mind
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.
thanks for the idea! 'underlying file handle' incorporated in the latest force push
i thought about throwing 'RAII" somewhere in here but could think of a good way to incorporate it |
7105f47
to
a1f9052
Compare
Maybe mention for |
@abonander maybe something about how it'll put an end-of-file at the end of whatever's already been written to it? |
src/libstd/process.rs
Outdated
@@ -534,7 +549,8 @@ impl Command { | |||
self | |||
} | |||
|
|||
/// Configuration for the child process's stdin handle (file descriptor 0). | |||
/// Configuration for the child process's standard input (stdin) handle | |||
/// (file descriptor 0). |
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.
The file descriptor 0
part seems awfully platform specific.
@abonander I'm not too familiar with the behavior/semantics of pipes w.r.t this. Does this sound right?
|
Added a couple more commits. Anyone else have thoughts? |
Seems good to me. @abonander What do you think about the note of child processes being unblocked? |
I can't say whether or not it's correct for all platforms but it answers OP's question in the Reddit post that spawned #41452 so I'm happy with it. |
Since this seems to be all set, i'll go ahead and get this in. @bors r+ rollup |
📌 Commit 859ebef has been approved by |
…etMisdreavus Indicate how ChildStd{in,out,err} FDs are closed. Fixes rust-lang#41452.
…etMisdreavus Indicate how ChildStd{in,out,err} FDs are closed. Fixes rust-lang#41452.
Fixes #41452.