|
|
Message-ID: <20261103235458.GP23438@brightrain.aerifal.cx>
Date: Tue, 3 Nov 2026 18:54:58 -0500
From: Rich Felker <dalias@...c.org>
To: Imre Kaloz <kaloz@...nel.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH 03/10] support archs whose clone indicates the
child in a second return register
On Mon, Nov 02, 2026 at 05:58:30PM +0100, Imre Kaloz wrote:
> An arch defining SYSCALL_CLONE_SUNOS supplies __syscall_clone_sunos,
> returning 0 in the child, for _Fork and vfork.
> ---
> src/process/_Fork.c | 4 +++-
> src/process/vfork.c | 4 +++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/process/_Fork.c b/src/process/_Fork.c
> index 9c07792d..93e177c8 100644
> --- a/src/process/_Fork.c
> +++ b/src/process/_Fork.c
> @@ -32,7 +32,9 @@ pid_t _Fork(void)
> sigset_t set;
> __block_all_sigs(&set);
> LOCK(__abort_lock);
> -#ifdef SYS_fork
> +#ifdef SYSCALL_CLONE_SUNOS
> + ret = __syscall_clone_sunos(SIGCHLD, 0);
> +#elif defined(SYS_fork)
> ret = __syscall(SYS_fork);
> #else
> ret = __syscall(SYS_clone, SIGCHLD, 0);
> diff --git a/src/process/vfork.c b/src/process/vfork.c
> index d430c13f..77463b28 100644
> --- a/src/process/vfork.c
> +++ b/src/process/vfork.c
> @@ -6,7 +6,9 @@
> pid_t vfork(void)
> {
> /* vfork syscall cannot be made from C code */
> -#ifdef SYS_fork
> +#ifdef SYSCALL_CLONE_SUNOS
> + return __syscall_ret(__syscall_clone_sunos(SIGCHLD, 0));
> +#elif defined(SYS_fork)
> return syscall(SYS_fork);
> #else
> return syscall(SYS_clone, SIGCHLD, 0);
> --
> 2.47.3
I don't see how this is motivated at all. Sparc has SYS_fork, so
SYS_clone will never be used in either of these places. And no new
arch is going to have this kind of wacky calling convention copying a
legacy proprietary unix.
Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.