]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: fix fork()
authorLaurent Vivier <laurent@vivier.eu>
Thu, 16 Feb 2017 17:37:07 +0000 (18:37 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 27 Feb 2017 22:10:02 +0000 (23:10 +0100)
commit7eddb5ddacb783ba325277b8f420530c2ae8a2ce
tree528fb8cac252116ef102d19fa01714969ab6a7b3
parent8f2d7c341184a95d05476ea3c45dbae2b9ddbe51
linux-user: fix fork()

Since commit 5ea2fc8 ("linux-user: Sanity check clone flags"),
trying to run fork() fails with old distro on some architectures.

This is the case with HP-PA and Debian 5 (Lenny).

It fails on:

         if ((flags & CSIGNAL) != TARGET_SIGCHLD) {
             return -TARGET_EINVAL;
         }

because flags is 17, whereas on HP-PA, SIGCHLD is 18.
17 is the SIGCHLD value of my host (x86_64).

It appears that for TARGET_NR_fork and TARGET_NR_vfork, QEMU calls
do_fork() with SIGCHLD instead of TARGET_SIGCHLD.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20170216173707.16209-1-laurent@vivier.eu>
linux-user/syscall.c