-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
In Unix, the first process argument is the executable name by convention. However, there are various occasions where you might want to set argv[0] to something other than the full executable path:
- to set a normalized program name
- to put multiple functions into one executable, selected by argv[0]
- to put commentary on the execution context for a process
- etc
I suggest adding a set_argv_0<S: AsRef<OsStr>(&mut self, arg: S) -> process::Command
to std::os::unix::process::CommandExt
to allow argv[0] to be overridden.
The default behaviour would remain unchanged.
It would require a little more implementation change - currently it always executes self.get_argv()[0]
, but this should be changed to self.program.as_ptr()
.
robbert-vdhXueTuostanislav-tkach
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.