implement Send for process::Command on unix
closes https://github.com/rust-lang/rust/issues/47751
This commit is contained in:
parent
9fd7da904b
commit
831ff77570
1 changed files with 5 additions and 0 deletions
|
|
@ -87,6 +87,11 @@ pub enum Stdio {
|
|||
Fd(FileDesc),
|
||||
}
|
||||
|
||||
// Command is not Send by default due to the Command.argv field containing a raw pointers. However
|
||||
// it is safe to implement Send, because anyway, these pointers point to memory owned by the
|
||||
// Command.args field.
|
||||
unsafe impl Send for Command {}
|
||||
|
||||
impl Command {
|
||||
pub fn new(program: &OsStr) -> Command {
|
||||
let mut saw_nul = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue