liblaunch: add task creation flags for use by fork and posix_spawn

This commit is contained in:
2026-05-30 10:09:14 +01:00
parent 3588bab1d7
commit d8d96777f2
3 changed files with 11 additions and 2 deletions
+2 -1
View File
@@ -174,7 +174,7 @@ static kern_status_t create_exec_regions(struct elf_image *image)
if (image->e_remote_space != KERN_HANDLE_INVALID) {
status = address_space_reserve(
image->e_remote_space,
MAP_ADDRESS_ANY,
0xF0000000,
image->e_total_size,
&image->e_remote_base);
}
@@ -188,6 +188,7 @@ static kern_status_t create_exec_regions(struct elf_image *image)
return status;
}
kern_tracef("launch: image base=%zx", image->e_remote_base);
return KERN_OK;
}
+2 -1
View File
@@ -25,7 +25,8 @@ enum launch_status {
};
enum launch_flags {
LAUNCH_F_NONE = 0,
LAUNCH_F_NONE = 0x00,
LAUNCH_F_CLONE_ALL_HANDLES = 0x01u,
};
struct launch_ctx;
+7
View File
@@ -123,8 +123,15 @@ enum launch_status launch_ctx_execute(
size_t name_len = params->p_task_name ? strlen(params->p_task_name) : 0;
kern_handle_t remote_task = KERN_HANDLE_INVALID,
remote_address_space = KERN_HANDLE_INVALID;
task_flags_t task_flags = TASK_F_DEFAULT;
if (flags & LAUNCH_F_CLONE_ALL_HANDLES) {
task_flags |= TASK_F_CLONE_ALL_HANDLES;
}
kstatus = task_create(
params->p_parent_task,
task_flags,
params->p_task_name,
name_len,
&remote_task,