Further improve usability of cosmocc

- Support -s flag in cosmocc
- Support posix_spawn() setsid() feature
- Disable monorepo debug path prefix stripping
This commit is contained in:
Justine Tunney 2023-07-10 05:55:00 -07:00
parent f7ae50462a
commit ee6566a152
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
9 changed files with 40 additions and 15 deletions

View file

@ -84,6 +84,12 @@ int posix_spawn(int *pid, const char *path,
if (!(child = vfork())) {
if (attrp && *attrp) {
posix_spawnattr_getflags(attrp, &flags);
if (flags & POSIX_SPAWN_SETSID) {
if (setsid()) {
STRACE("posix_spawn fail #%d", 1);
_Exit(127);
}
}
if (flags & POSIX_SPAWN_SETPGROUP) {
if (setpgid(0, (*attrp)->pgroup)) {
STRACE("posix_spawn fail #%d", 1);