1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:47:35 +00:00

LibC: Add posix_spawn()!

All the file actions stuff is still missing for now,
as is POSIX_SPAWN_SETSCHEDULER (not sure what that's
supposed to do) and POSIX_SPAWN_RESETIDS.

Implemented in userspace for now. Once there are users,
it'll likely make sense to make this a syscall for
performance reasons.

A simple test program of the form

    extern char **environ;
    int main(int argc, char* argv[])
    {
        pid_t pid;
        char* args[] = { "ls", NULL };
        posix_spawnp(&pid, "ls", nullptr, nullptr, args, environ);
    }

works fine.
This commit is contained in:
Nico Weber 2020-06-15 21:36:08 -04:00 committed by Andreas Kling
parent 662131bd38
commit 4720635aab
3 changed files with 334 additions and 0 deletions

View file

@ -25,6 +25,7 @@ set(LIBC_SOURCES
serenity.cpp
setjmp.S
signal.cpp
spawn.cpp
stat.cpp
stdio.cpp
stdlib.cpp