tools/nolibc: Implement fork() based on clone()
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Jan 2021 07:20:26 +0000 (08:20 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 21 Jan 2021 18:06:44 +0000 (10:06 -0800)
commitbe60ca41fbaa93bc8f92b24e34d8cc62af41300d
treeaf3031c5f156ad307d8774922eaad563423ddd8e
parentc0c7c103756fee25aadfd5c36f7b86e318f9abb4
tools/nolibc: Implement fork() based on clone()

Some archs such as arm64 do not have fork() and have to use clone()
instead.  This commit therefore makes fork() use clone() when
available. This requires including signal.h to get the definition of
SIGCHLD.  This is a port of nolibc's upstream commit d2dc42fd6149 to
the Linux kernel.

Fixes: 66b6f755ad45 ("rcutorture: Import a copy of nolibc")
Tested-by: Valentin Schneider <valentin.schneider@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/nolibc.h