diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-06-12 21:40:42 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-06-30 10:41:39 +0000 |
commit | b88d509e58f4e5c88d767012e0ed898d581eda55 (patch) | |
tree | 292e96b14ca0a3e5aab993d54b3e086c3a426d2d /src/corelib/io | |
parent | b619f2a26ea2ab56e18a3f9a8b635f96fc479563 (diff) |
forkfd: remove FFD_VFORK_SEMANTICS
This will never work, not unless libc implements it
themselves, since the child process is not allowed to return
from the function that does the vfork(), as subsequent use
of the stack would trash the frozen parent's return address,
and in our case that's syscall(). Instead, we may add a
vforkfd() function that takes a callback function that will
be called in that context, like the glibc clone(3) wrapper
does.
Change-Id: I1dba29bc0f454df09ca1fffd161800b453c00593
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 4e2f4670362d2ab8eed55be0cf699b24d658c3e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index e8efe6481f..50390e57f5 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -461,8 +461,6 @@ void QProcessPrivate::startProcess() int ffdflags = FFD_CLOEXEC; if (typeid(*q) != typeid(QProcess)) ffdflags |= FFD_USE_FORK; - else - ffdflags |= FFD_VFORK_SEMANTICS; pid_t childPid; forkfd = ::forkfd(ffdflags , &childPid); int lastForkErrno = errno; |