File tree 1 file changed +7
-2
lines changed 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -326,8 +326,13 @@ impl Drop for PosixSpawnFileActions {
326
326
}
327
327
}
328
328
329
- // Specifically for use with posix_spawn and posix_spawnp.
330
- // https://github.com/rust-lang/libc/issues/1272
329
+ // The POSIX standard requires those `args` and `envp` to be of type `*const *mut [c_char]`,
330
+ // but implementations won't modify them, making the `mut` type redundant. Considering this,
331
+ // Nix does not expose this mutability, but we have to change the interface when calling the
332
+ // underlying libc interfaces , this helper function does the conversion job.
333
+ //
334
+ // SAFETY:
335
+ // It is safe to add the mutability in types as implementations won't mutable them.
331
336
unsafe fn to_exec_array < S : AsRef < CStr > > ( args : & [ S ] ) -> Vec < * mut libc:: c_char > {
332
337
let mut v: Vec < * mut libc:: c_char > = args
333
338
. iter ( )
You can’t perform that action at this time.
0 commit comments