History log of /seL4-refos-master/libs/libmuslc/src/process/posix_spawn_file_actions_adddup2.c
Revision Date Author Comments
# fb6b159d 03-Feb-2013 Rich Felker <dalias@aerifal.cx>

overhaul posix_spawn to use CLONE_VM instead of vfork

the proposed change was described in detail in detail previously on
the mailing list. in short, vfork is unsafe because:

1. the compiler could make optimizations that cause the child to
clobber the parent's local vars.

2. strace is buggy and allows the vforking parent to run before the
child execs when run under strace.

the new design uses a close-on-exec pipe instead of vfork semantics to
synchronize the parent and child so that the parent does not return
before the child has finished using its arguments (and now, also its
stack). this also allows reporting exec failures to the caller instead
of giving the caller a child that mysteriously exits with status 127
on exec error.

basic testing has been performed on both the success and failure code
paths. further testing should be done.


# f48832ee 28-May-2011 Rich Felker <dalias@aerifal.cx>

fix backwards posix_spawn file action order


# a0ae0b09 28-May-2011 Rich Felker <dalias@aerifal.cx>

add file actions support to posix_spawn