liblaunch: add task creation flags for use by fork and posix_spawn
This commit is contained in:
+2
-1
@@ -174,7 +174,7 @@ static kern_status_t create_exec_regions(struct elf_image *image)
|
|||||||
if (image->e_remote_space != KERN_HANDLE_INVALID) {
|
if (image->e_remote_space != KERN_HANDLE_INVALID) {
|
||||||
status = address_space_reserve(
|
status = address_space_reserve(
|
||||||
image->e_remote_space,
|
image->e_remote_space,
|
||||||
MAP_ADDRESS_ANY,
|
0xF0000000,
|
||||||
image->e_total_size,
|
image->e_total_size,
|
||||||
&image->e_remote_base);
|
&image->e_remote_base);
|
||||||
}
|
}
|
||||||
@@ -188,6 +188,7 @@ static kern_status_t create_exec_regions(struct elf_image *image)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kern_tracef("launch: image base=%zx", image->e_remote_base);
|
||||||
return KERN_OK;
|
return KERN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ enum launch_status {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum launch_flags {
|
enum launch_flags {
|
||||||
LAUNCH_F_NONE = 0,
|
LAUNCH_F_NONE = 0x00,
|
||||||
|
LAUNCH_F_CLONE_ALL_HANDLES = 0x01u,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct launch_ctx;
|
struct launch_ctx;
|
||||||
|
|||||||
@@ -123,8 +123,15 @@ enum launch_status launch_ctx_execute(
|
|||||||
size_t name_len = params->p_task_name ? strlen(params->p_task_name) : 0;
|
size_t name_len = params->p_task_name ? strlen(params->p_task_name) : 0;
|
||||||
kern_handle_t remote_task = KERN_HANDLE_INVALID,
|
kern_handle_t remote_task = KERN_HANDLE_INVALID,
|
||||||
remote_address_space = 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(
|
kstatus = task_create(
|
||||||
params->p_parent_task,
|
params->p_parent_task,
|
||||||
|
task_flags,
|
||||||
params->p_task_name,
|
params->p_task_name,
|
||||||
name_len,
|
name_len,
|
||||||
&remote_task,
|
&remote_task,
|
||||||
|
|||||||
Reference in New Issue
Block a user