about summary refs log tree commit diff
path: root/src/process/posix_spawn_file_actions_adddup2.c
Commit message (Collapse)AuthorAgeFilesLines
* fail posix_spawn file_actions operations with negative fdsRich Felker2021-01-301-0/+1
| | | | | | | | | | | these functions are specified to fail with EBADF on negative fd arguments. apart from close, they are also specified to fail if the value exceeds OPEN_MAX, but as written it is not clear that this imposes any requirement when OPEN_MAX is not defined, and it's undesirable to impose a dynamic limit (via setrlimit) here since the limit at the time of posix_spawn may be different from the limit at the time of setting up the file actions. this may require revisiting later.
* overhaul posix_spawn to use CLONE_VM instead of vforkRich Felker2013-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* fix backwards posix_spawn file action orderRich Felker2011-05-291-1/+2
|
* add file actions support to posix_spawnRich Felker2011-05-281-0/+16