]> git.ipfire.org Git - thirdparty/glibc.git/commit
posix: Improve default posix_spawn implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 24 Apr 2017 18:50:19 +0000 (15:50 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 29 Jun 2017 13:59:07 +0000 (10:59 -0300)
commitccfb2964726512f6669fea99a43afa714e2e6a80
treeb78d9541645f66e93bc0c45b6e583210548d4de8
parentedc1686af0c0fc2eb535f1d38cdf63c1a5a03675
posix: Improve default posix_spawn implementation

This patch improves the default posix implementation of posix_spawn{p}
and align with Linux one.  The main idea is to fix some issues already
fixed in Linux code, and deprecated vfork internal usage (source of
various bug reports).  In a short:

   - It moves POSIX_SPAWN_USEVFORK usage and sets it a no-op.  Since
     the process that actually spawn the new process do not share
     memory with parent (with vfork), it fixes BZ#14750 for this
     implementation.

   - It uses a pipe to correctly obtain the return upon failure
     of execution (BZ#18433).

   - It correctly enable/disable asynchronous cancellation (checked
     on ptl/tst-exec5.c).

   - It correctly disable/enable signal handling.

Using this version instead of Linux shows only one regression,
posix/tst-spawn3, because of pipe2 usage which increase total
number of file descriptor.

* sysdeps/posix/spawni.c (__spawni_child): New function.
(__spawni): Rename to __spawnix.
ChangeLog
sysdeps/posix/spawni.c