History log of /seL4-test-master/projects/musllibc/src/stdio/popen.c
Revision Date Author Comments
# fe80a8eb 01-Sep-2013 Rich Felker <dalias@aerifal.cx>

fix special-case breakage in popen due to reversed argument order


# 9cb6e6ea 24-Mar-2013 Rich Felker <dalias@aerifal.cx>

rewrite popen to use posix_spawn instead of fragile vfork hacks


# efd4d87a 08-Nov-2012 Rich Felker <dalias@aerifal.cx>

clean up sloppy nested inclusion from pthread_impl.h

this mirrors the stdio_impl.h cleanup. one header which is not
strictly needed, errno.h, is left in pthread_impl.h, because since
pthread functions return their error codes rather than using errno,
nearly every single pthread function needs the errno constants.

in a few places, rather than bringing in string.h to use memset, the
memset was replaced by direct assignment. this seems to generate much
better code anyway, and makes many functions which were previously
non-leaf functions into leaf functions (possibly eliminating a great
deal of bloat on some platforms where non-leaf functions require ugly
prologue and/or epilogue).


# f1b23d41 21-Oct-2012 Rich Felker <dalias@aerifal.cx>

fix copy/paste error in popen changes that broke signals

signal mask was not being restored after fork, but instead blocked again.


# 599f9736 19-Oct-2012 Rich Felker <dalias@aerifal.cx>

fix usage of locks with vfork

__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.


# 44eb4d8b 18-Oct-2012 Rich Felker <dalias@aerifal.cx>

overhaul system() and popen() to use vfork; fix various related bugs

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.


# 9c21f434 20-Jun-2012 Rich Felker <dalias@aerifal.cx>

make popen cancellation-safe

close was the only cancellation point called from popen, but it left
popen with major resource leaks if any call to close got cancelled.
the easiest, cheapest fix is just to use a non-cancellable close
function.


# f305467a 20-Jun-2012 Rich Felker <dalias@aerifal.cx>

popen: handle issues with fd0/1 being closed

also check for failure of dup2 and abort the child rather than
reading/writing the wrong file.


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0