LIBPOSIX_PROCESS_SRCS-$(CONFIG_LIBPOSIX_PROCESS_EXECVE) += $(LIBPOSIX_PROCESS_BASE)/arch/$(CONFIG_UK_ARCH)/execve.c|arch
LIBPOSIX_PROCESS_SRCS-$(CONFIG_LIBPOSIX_PROCESS_VFORK) += $(LIBPOSIX_PROCESS_BASE)/vfork.c
+LIBPOSIX_PROCESS_SRCS-$(CONFIG_LIBPOSIX_PROCESS_VFORK) += $(LIBPOSIX_PROCESS_BASE)/arch/$(CONFIG_UK_ARCH)/vfork.S|arch
LIBPOSIX_PROCESS_SRCS-y += $(LIBPOSIX_PROCESS_BASE)/deprecated.c
LIBPOSIX_PROCESS_SRCS-y += $(LIBPOSIX_PROCESS_BASE)/process.c
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2025, Unikraft GmbH and The Unikraft Authors.
+ * Licensed under the BSD-3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ */
+
+#include <uk/syscall.h>
+
+/*
+ * NOTE: We need to replicate this assembly libc wrapper in our
+ * supported/ported external libc libraries (e.g. musl) because their
+ * wrappers do not typically tailor to our use case of having system calls
+ * regular function calls.
+ *
+ * Whenever porting a new libc library, make sure to replicate this code there
+ * as well, unless the library in question does somehow indeed have a more
+ * special wrapper that still allows our vfork functionality to still work
+ * correctly.
+ */
+#if UK_LIBC_SYSCALLS
+.global vfork
+vfork:
+ b uk_syscall_e_vfork
+#endif /* UK_LIBC_SYSCALLS */
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright (c) 2025, Unikraft GmbH and The Unikraft Authors.
+ * Licensed under the BSD-3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ */
+
+#include <uk/syscall.h>
+
+/*
+ * NOTE: We need to replicate this assembly libc wrapper in our
+ * supported/ported external libc libraries (e.g. musl) because their
+ * wrappers do not typically tailor to our use case of having system calls
+ * regular function calls.
+ *
+ * Whenever porting a new libc library, make sure to replicate this code there
+ * as well, unless the library in question does somehow indeed have a more
+ * special wrapper that still allows our vfork functionality to still work
+ * correctly.
+ */
+#if UK_LIBC_SYSCALLS
+.global vfork
+vfork:
+ jmp uk_syscall_e_vfork
+#endif /* UK_LIBC_SYSCALLS */