ITADN

Add CWD option to subprocess_create_ex

#83Pull Requestcaesay 创建于 2024-03-06
C
caesaycommented
Closes #52. Disclaimer: I am not a posix developer. I verified the Windows code works, but did not test the UNIX stuff. I just copied this code from that issue without testing: ```cpp // Set working directory if (0 != posix_spawn_file_actions_addchdir_np(&actions, process_cwd)) { posix_spawn_file_actions_destroy(&actions); return -1; } ``` I did notice that there was a `posix_spawn_file_actions_addchdir_np` function (from the screenshot) and a `posix_spawn_file_actions_addchdir` function, the latter of which is "portable" and the former is "non-portable". I don't really understand what that means in this context, however when searching I did notice that Rust uses the "non-portable" variation, so I'm guessing it's the preferred one.
合并状态:未合并 5 条评论