fn check_sigaction_error(
signal: SignalFlags,
action: usize,
old_action: usize
) -> bool
diff --git a/ch7/os/syscall/process/fn.check_sigaction_error.html b/ch7/os/syscall/process/fn.check_sigaction_error.html index 7fca075b..ecd4b552 100644 --- a/ch7/os/syscall/process/fn.check_sigaction_error.html +++ b/ch7/os/syscall/process/fn.check_sigaction_error.html @@ -1 +1 @@ -
fn check_sigaction_error(
signal: SignalFlags,
action: usize,
old_action: usize
) -> bool
fn check_sigaction_error(
signal: SignalFlags,
action: usize,
old_action: usize
) -> bool
pub fn sys_sigaction(
signum: i32,
action: *const SignalAction,
old_action: *mut SignalAction
) -> isize
pub fn sys_sigaction(
signum: i32,
action: *const SignalAction,
old_action: *mut SignalAction
) -> isize
If there is not a child process whose pid is same as given, return -1. +
If there is not a child process whose pid is same as given, return -1. Else if there is a child process but it is still running, return -2.
use crate::fs::{open_file, OpenFlags};
use crate::mm::{translated_ref, translated_refmut, translated_str};
use crate::task::{
@@ -331,7 +334,10 @@
// restore the trap context
let trap_ctx = inner.get_trap_cx();
*trap_ctx = inner.trap_ctx_backup.unwrap();
- 0
+ // Here we return the value of a0 in the trap_ctx,
+ // otherwise it will be overwritten after we trap
+ // back to the original execution of the application.
+ trap_ctx.x[10] as isize
} else {
-1
}