diff options
| author | BaoshanPang <pangbw@gmail.com> | 2020-01-17 09:29:09 -0800 |
|---|---|---|
| committer | BaoshanPang <pangbw@gmail.com> | 2020-01-24 09:59:59 -0800 |
| commit | 06af44238f2b7a82995dc0a354403ab68dab7cc5 (patch) | |
| tree | 1fcf45ae81d98b6514c779fc5f59b14da1bd8f1b /src/libstd/sys/vxworks/ext | |
| parent | cec957e1542c062e97f664aab5b23ebd532f5c85 (diff) | |
| download | rust-06af44238f2b7a82995dc0a354403ab68dab7cc5.tar.gz rust-06af44238f2b7a82995dc0a354403ab68dab7cc5.zip | |
Support feature process_set_argv0 for VxWorks
Diffstat (limited to 'src/libstd/sys/vxworks/ext')
| -rw-r--r-- | src/libstd/sys/vxworks/ext/process.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libstd/sys/vxworks/ext/process.rs b/src/libstd/sys/vxworks/ext/process.rs index e535c4aa122..31e691dd136 100644 --- a/src/libstd/sys/vxworks/ext/process.rs +++ b/src/libstd/sys/vxworks/ext/process.rs @@ -2,6 +2,7 @@ #![stable(feature = "rust1", since = "1.0.0")] +use crate::ffi::OsStr; use crate::io; use crate::process; use crate::sys; @@ -105,6 +106,15 @@ pub trait CommandExt { /// cross-platform `spawn` instead. #[stable(feature = "process_exec2", since = "1.9.0")] fn exec(&mut self) -> io::Error; + + /// Set executable argument + /// + /// Set the first process argument, `argv[0]`, to something other than the + /// default executable path. + #[unstable(feature = "process_set_argv0", issue = "66510")] + fn arg0<S>(&mut self, arg: S) -> &mut process::Command + where + S: AsRef<OsStr>; } #[stable(feature = "rust1", since = "1.0.0")] @@ -130,6 +140,14 @@ impl CommandExt for process::Command { fn exec(&mut self) -> io::Error { self.as_inner_mut().exec(sys::process::Stdio::Inherit) } + + fn arg0<S>(&mut self, arg: S) -> &mut process::Command + where + S: AsRef<OsStr>, + { + self.as_inner_mut().set_arg_0(arg.as_ref()); + self + } } /// Unix-specific extensions to [`process::ExitStatus`]. |
