]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
lib/posix-process: Refactor Kconfig options
authorMichalis Pappas <michalis@unikraft.io>
Wed, 19 Mar 2025 07:14:56 +0000 (08:14 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 30 Apr 2025 09:42:51 +0000 (09:42 +0000)
commitde9adc5a6f50ca272d0c99f3489125ea7a12d90b
treeee43c32c2a8b897d311695a5cbe6616b4845a19f
parent56da4c412b6d63469477230cc02dd3dfb98a2ba1
lib/posix-process: Refactor Kconfig options

Replace CONFIG_LIBPOSIX_PROCESS_PIDS and CONFIG_LIBPOSIX_PROCESS_CLONE
with a single option, CONFIG_LIBPOSIX_PROCESS_MULTITHREADING. This
option enables clone(), _exit(), and exit_group() syscalls as well as
the core logic of libposix-process. Make options previously relevant
to CONFIG_LIBPOSIX_PROCESS_CLONE move to subselection of multithreading.

Without CONFIG_LIBPOSIX_PROCESS_MULTITHREADING the implementation falls
back into stubs. This provides an execution environment for simple
libc-based applications that don't require multithreading, but still
need to execute under a process-like environment. Under this state,
the syscalls involved in multithreading (or multiprocess) return an
error, while others are emulated. Notice that if Unikraft is not configured
to execute main() in a separate uk_thread (i.e. LIBUKBOOT_MAINTHREAD),
_exit() and exit_group() are not available.

Introduce a new config option to enable multiprocess support, namely
CONFIG_LIBPOSIX_PROCESS_MULTIPROCESS. This option replaces the config
option of vfork(), and enforces the selection of multithreading and
execve().

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1627
lib/posix-process/Config.uk
lib/posix-process/Makefile.uk
lib/posix-process/clone.c
lib/posix-process/include/linux/sched.h
lib/posix-process/include/uk/process.h
lib/posix-process/process.c
lib/posix-process/process.h
lib/posix-process/signal/signal.h