mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Respect user-defined exit signal in clone() and clone3()
When calling clone() and clone3(), the user is allowed to specify a signal to be sent to the parent process on exit. Respect this value by storing it in the Process struct and sending the signal on exit. Add a test as well to verify that the signal is properly delivered to the parent.
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
130a0f7030
commit
0a36760f7a
@ -345,6 +345,10 @@ fn clone_child_process(
|
||||
process_builder.build()?
|
||||
};
|
||||
|
||||
if let Some(sig) = clone_args.exit_signal {
|
||||
child.set_exit_signal(sig);
|
||||
};
|
||||
|
||||
// Deals with clone flags
|
||||
let child_thread = thread_table::get_thread(child_tid).unwrap();
|
||||
let child_posix_thread = child_thread.as_posix_thread().unwrap();
|
||||
|
Reference in New Issue
Block a user