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 @@ -342,8 +342,13 @@ impl Drop for PosixSpawnFileActions {
342
342
}
343
343
}
344
344
345
- // Specifically for use with posix_spawn and posix_spawnp.
346
- // https://github.com/rust-lang/libc/issues/1272
345
+ // The POSIX standard requires those `args` and `envp` to be of type `*const *mut [c_char]`,
346
+ // but implementations won't modify them, making the `mut` type redundant. Considering this,
347
+ // Nix does not expose this mutability, but we have to change the interface when calling the
348
+ // underlying libc interfaces , this helper function does the conversion job.
349
+ //
350
+ // SAFETY:
351
+ // It is safe to add the mutability in types as implementations won't mutable them.
347
352
unsafe fn to_exec_array < S : AsRef < CStr > > ( args : & [ S ] ) -> Vec < * mut libc:: c_char > {
348
353
let mut v: Vec < * mut libc:: c_char > = args
349
354
. iter ( )
You can’t perform that action at this time.
0 commit comments