Rollup merge of #137463 - sunshowers:illumos-posix-spawn, r=Mark-Simulacrum

[illumos] attempt to use posix_spawn to spawn processes

illumos has `posix_spawn`, and the very newest versions also have `_addchdir`, so use that. POSIX standardized this function so I also added a weak symbol lookup for the non `_np` version. (illumos has both.)

This probably also works on Solaris, but I don't have access to an installation to validate this so I decided to focus on illumos instead.

This is a nice ~4x performance improvement for process creation. My go-to as usual is nextest against the clap repo, which acts as a stress test for process creation -- with [this commit]:

```console
$ cargo nextest run -E 'not test(ui_tests) and not test(example_tests)'
before: Summary [   1.747s] 879 tests run: 879 passed, 2 skipped
after:  Summary [   0.445s] 879 tests run: 879 passed, 2 skipped
```

[this commit]: fde45f9aea
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2025-03-05 21:46:40 +08:00 committed by GitHub
commit 228eb1fe6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

Diff Content Not Available