Export to GitHub

tenfourfox - issue #66

Implement userland posix_spawn library in terms of vfork/execve/dup2


Posted on Jun 4, 2011 by Massive Rhino

Eventually we will need to deal with IPC for real instead of our gutted hal-fassed IPC that isn't ("just enough Chrome"). However, this requires writing posix_spawn in userland. Fortunately, the OpenGroup has just such an implementation available that we can adapt to our needs: http://pubs.opengroup.org/onlinepubs/000095399/xrat/xsh_chap03.html

We will probably just make a simple stub for posix_spawnp since we don't really support searching the PATH (i.e., _spawnp just maps to _spawn).

We should compare this to one of the BSD kernel posix_spawn implementations after we port it to make sure all the bases are covered.

This will not be done until we have to, because something like this could have very subtle bugs, and what we have now does work.

Attachments

Comment #1

Posted on Jun 4, 2011 by Massive Rhino

Of course, since we have vfork() in 10.4, we should really use that.

Comment #2

Posted on Jun 10, 2011 by Massive Rhino

Suggested by Jonas Maebe. We need to blot out the FreeBSD-specific yuk, but this is more complete than the OpenGroup version.

http://fxr.watson.org/fxr/source/gen/posix_spawn.c?v=FREEBSD-LIBC

Attachments

Status: Accepted

Labels:
Type-Defect Priority-Medium