@@ -60,25 +60,13 @@ cfg_if::cfg_if! {
6060////////////////////////////////////////////////////////////////////////////////
6161
6262pub struct Command {
63- // Currently we try hard to ensure that the call to `.exec()` doesn't
64- // actually allocate any memory. While many platforms try to ensure that
65- // memory allocation works after a fork in a multithreaded process, it's
66- // been observed to be buggy and somewhat unreliable, so we do our best to
67- // just not do it at all!
68- //
69- // Along those lines, the `argv` and `envp` raw pointers here are exactly
70- // what's gonna get passed to `execvp`. The `argv` array starts with the
71- // `program` and ends with a NULL, and the `envp` pointer, if present, is
72- // also null-terminated.
73- //
74- // Right now we don't support removing arguments, so there's no much fancy
75- // support there, but we support adding and removing environment variables,
76- // so a side table is used to track where in the `envp` array each key is
77- // located. Whenever we add a key we update it in place if it's already
78- // present, and whenever we remove a key we update the locations of all
79- // other keys.
8063 program : CString ,
8164 args : Vec < CString > ,
65+ /// Exactly what will be passed to `execvp`.
66+ ///
67+ /// First element is a pointer to `program`, followed by pointers to
68+ /// `args`, followed by a `null`. Be careful when modifying `program` or
69+ /// `args` to properly update this as well.
8270 argv : Argv ,
8371 env : CommandEnv ,
8472
0 commit comments