-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[solarish/illumos] add the posix_spawn family of functions #4259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The freebsd build failures are unrelated I believe. |
e006967 to
4224e94
Compare
| POSIX_FADV_RANDOM | ||
| POSIX_FADV_SEQUENTIAL | ||
| POSIX_FADV_WILLNEED | ||
| POSIX_SPAWN_SETSID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solaris 11.4 does have POSIX_SPAWN_SETSID too. But it's different number:
grep POSIX_SPAWN_SETSID /usr/include/sys/spawn.h
#define POSIX_SPAWN_SETSID 0x0400
#define POSIX_SPAWN_SETSID_NP POSIX_SPAWN_SETSID /* pre-standard */
So I think it's ok to keep it separately as you have it.
4224e94 to
8f57f27
Compare
| pub const POSIX_SPAWN_SETSID: c_short = 0x400; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see a solaris.txt, and I wasn't sure whether a definition being in both solaris.rs and illumos.rs was enough to put it in solarish.txt.
Add definitions from `spawn.h` as present [in illumos-gate (blame view)][spawn-h]. I added definitions more than 15 years old to `solarish/mod.rs`, and others to `solarish/illumos.rs`. There are a lot of definitions here -- it's easiest to look at them in the blame view linked above. But here are the corresponding man pages: For solarish: * [`posix_spawn`, `posix_spawnp`](https://illumos.org/man/3C/posix_spawn) * [`posix_spawn_file_actions_{init,destroy}`](https://illumos.org/man/3C/posix_spawn_file_actions_init) * [`posix_spawn_file_actions_{addopen,addclose}`](https://illumos.org/man/3C/posix_spawn_file_actions_addopen) * [`posix_spawn_file_actions_adddup2`](https://illumos.org/man/3C/posix_spawn_file_actions_adddup2) * [`posix_spawn_file_actions_addclosefrom_np`](https://illumos.org/man/3C/posix_spawn_file_actions_addclosefrom_np) * [`posix_spawnattr_{init,destroy}`](https://illumos.org/man/3C/posix_spawnattr_init) * [`posix_spawnattr_{setflags,getflags}`](https://illumos.org/man/3C/posix_spawnattr_setflags) * [`posix_spawnattr_{setpgroup,getpgroup}`](https://illumos.org/man/3C/posix_spawnattr_setpgroup) * [`posix_spawnattr_{setschedparam,getschedparam}`](https://illumos.org/man/3C/posix_spawnattr_setschedparam) * [`posix_spawnattr_{setschedpolicy,getschedpolicy}`](https://illumos.org/man/3C/posix_spawnattr_setschedpolicy) * [`posix_spawnattr_{setsigdefault,getsigdefault}`](https://illumos.org/man/3C/posix_spawnattr_setsigdefault) * [`posix_spawnattr_{setsigignore,getsigignore}_np`](https://illumos.org/man/3C/posix_spawnattr_setsigignore_np) * [`posix_spawnattr_{setsigmask,getsigmask}`](https://illumos.org/man/3C/posix_spawnattr_setsigmask) Newer functions added independently to Solaris and illumos: * [`posix_spawn_file_actions_{addchdir,addchdir_np,addfchdir}` on Solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/posix-spawn-file-actions-addchdir-np-3c.html) * The illumos-only functions are quite recent so the man pages haven't been uploaded to illumos.org yet. But [here's the one for `addchdir` and `addfchdir`](https://github.com/illumos/illumos-gate/blob/7633a05bff8c639f2df722d1fba7b889b2763d3d/usr/src/man/man3c/posix_spawn_file_actions_addchdir.3c). Note that the `_np` functions are not documented in the manual, but they are available for compatibility. The one function I skipped over was [`posix_spawn_pipe_np`](https://illumos.org/man/3C/posix_spawn_pipe_np) -- it seemed a bit niche and I wasn't quite sure how to model `boolean_t`. [spawn-h]: https://github.com/illumos/illumos-gate/blame/7633a05bff8c639f2df722d1fba7b889b2763d3d/usr/src/head/spawn.h#L1
8f57f27 to
162e306
Compare
psumbera
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok to go. Thank you for the changes!
tgross35
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Add definitions from `spawn.h` as present [in illumos-gate (blame view)][spawn-h]. I added definitions more than 15 years old to `solarish/mod.rs`, and others to `solarish/illumos.rs`. There are a lot of definitions here -- it's easiest to look at them in the blame view linked above. But here are the corresponding man pages: For solarish: * [`posix_spawn`, `posix_spawnp`](https://illumos.org/man/3C/posix_spawn) * [`posix_spawn_file_actions_{init,destroy}`](https://illumos.org/man/3C/posix_spawn_file_actions_init) * [`posix_spawn_file_actions_{addopen,addclose}`](https://illumos.org/man/3C/posix_spawn_file_actions_addopen) * [`posix_spawn_file_actions_adddup2`](https://illumos.org/man/3C/posix_spawn_file_actions_adddup2) * [`posix_spawn_file_actions_addclosefrom_np`](https://illumos.org/man/3C/posix_spawn_file_actions_addclosefrom_np) * [`posix_spawnattr_{init,destroy}`](https://illumos.org/man/3C/posix_spawnattr_init) * [`posix_spawnattr_{setflags,getflags}`](https://illumos.org/man/3C/posix_spawnattr_setflags) * [`posix_spawnattr_{setpgroup,getpgroup}`](https://illumos.org/man/3C/posix_spawnattr_setpgroup) * [`posix_spawnattr_{setschedparam,getschedparam}`](https://illumos.org/man/3C/posix_spawnattr_setschedparam) * [`posix_spawnattr_{setschedpolicy,getschedpolicy}`](https://illumos.org/man/3C/posix_spawnattr_setschedpolicy) * [`posix_spawnattr_{setsigdefault,getsigdefault}`](https://illumos.org/man/3C/posix_spawnattr_setsigdefault) * [`posix_spawnattr_{setsigignore,getsigignore}_np`](https://illumos.org/man/3C/posix_spawnattr_setsigignore_np) * [`posix_spawnattr_{setsigmask,getsigmask}`](https://illumos.org/man/3C/posix_spawnattr_setsigmask) Newer functions added independently to Solaris and illumos: * [`posix_spawn_file_actions_{addchdir,addchdir_np,addfchdir}` on Solaris](https://docs.oracle.com/cd/E88353_01/html/E37843/posix-spawn-file-actions-addchdir-np-3c.html) * The illumos-only functions are quite recent so the man pages haven't been uploaded to illumos.org yet. But [here's the one for `addchdir` and `addfchdir`](https://github.com/illumos/illumos-gate/blob/7633a05bff8c639f2df722d1fba7b889b2763d3d/usr/src/man/man3c/posix_spawn_file_actions_addchdir.3c). Note that the `_np` functions are not documented in the manual, but they are available for compatibility. The one function I skipped over was [`posix_spawn_pipe_np`](https://illumos.org/man/3C/posix_spawn_pipe_np) -- it seemed a bit niche and I wasn't quite sure how to model `boolean_t`. [spawn-h]: https://github.com/illumos/illumos-gate/blame/7633a05bff8c639f2df722d1fba7b889b2763d3d/usr/src/head/spawn.h#L1 (backport <rust-lang#4259>) (cherry picked from commit 162e306)
Description
Add definitions from
spawn.has present in illumos-gate (blame view). I added definitions more than 15 years old tosolarish/mod.rs, and others tosolarish/illumos.rs.Sources
There are a lot of definitions here -- it's easiest to look at them in the blame view linked above. But here are the corresponding man pages:
For solarish:
posix_spawn,posix_spawnpposix_spawn_file_actions_{init,destroy}posix_spawn_file_actions_{addopen,addclose}posix_spawn_file_actions_adddup2posix_spawn_file_actions_addclosefrom_npposix_spawnattr_{init,destroy}posix_spawnattr_{setflags,getflags}posix_spawnattr_{setpgroup,getpgroup}posix_spawnattr_{setschedparam,getschedparam}posix_spawnattr_{setschedpolicy,getschedpolicy}posix_spawnattr_{setsigdefault,getsigdefault}posix_spawnattr_{setsigignore,getsigignore}_npposix_spawnattr_{setsigmask,getsigmask}Newer functions added independently to Solaris and illumos:
posix_spawn_file_actions_{addchdir,addchdir_np,addfchdir}on SolarisThe illumos-only functions are quite recent so the man pages haven't been uploaded to illumos.org yet. But here's the one for
addchdirandaddfchdir.Note that the
_npfunctions are not documented in the manual, but they are available for compatibility.The one function I skipped over was
posix_spawn_pipe_np-- it seemed a bit niche and I wasn't quite sure how to modelboolean_t.Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI