Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20261102165837.24591-4-kaloz@kernel.org>
Date: Mon,  2 Nov 2026 17:58:30 +0100
From: Imre Kaloz <kaloz@...nel.org>
To: musl@...ts.openwall.com
Subject: [PATCH 03/10] support archs whose clone indicates the child in a second return register

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

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.