summaryrefslogtreecommitdiff
path: root/src/process/system.c
AgeCommit message (Collapse)AuthorLines
2012-10-28system is a cancellation pointRich Felker-0/+3
ideally, system would also be cancellable while running the external command, but I cannot find any way to make that work without either leaking zombie processes or introducing behavior that is far outside what the standard specifies. glibc handles cancellation by killing the child process with SIGKILL, but this could be unsafe in that it could leave the data being manipulated by the command in an inconsistent state.
2012-10-19fix usage of locks with vforkRich Felker-1/+2
__release_ptc() is only valid in the parent; if it's performed in the child, the lock will be unlocked early then double-unlocked later, corrupting the lock state.
2012-10-18overhaul system() and popen() to use vfork; fix various related bugsRich Felker-23/+42
since we target systems without overcommit, special care should be taken that system() and popen(), like posix_spawn(), do not fail in processes whose commit charges are too high to allow ordinary forking. this in turn requires special precautions to ensure that the parent process's signal handlers do not end up running in the shared-memory child, where they could corrupt the state of the parent process. popen has also been updated to use pipe2, so it does not have a fd-leak race in multi-threaded programs. since pipe2 is missing on older kernels, (non-atomic) emulation has been added. some silly bugs in the old code should be gone too.
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+45