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 @@ -check_sigaction_error in os::syscall::process - Rust
fn check_sigaction_error(
    signal: SignalFlags,
    action: usize,
    old_action: usize
) -> bool
\ No newline at end of file +check_sigaction_error in os::syscall::process - Rust
fn check_sigaction_error(
    signal: SignalFlags,
    action: usize,
    old_action: usize
) -> bool
\ No newline at end of file diff --git a/ch7/os/syscall/process/fn.sys_sigaction.html b/ch7/os/syscall/process/fn.sys_sigaction.html index d15e5642..645e5bc9 100644 --- a/ch7/os/syscall/process/fn.sys_sigaction.html +++ b/ch7/os/syscall/process/fn.sys_sigaction.html @@ -1 +1 @@ -sys_sigaction in os::syscall::process - Rust
pub fn sys_sigaction(
    signum: i32,
    action: *const SignalAction,
    old_action: *mut SignalAction
) -> isize
\ No newline at end of file +sys_sigaction in os::syscall::process - Rust
pub fn sys_sigaction(
    signum: i32,
    action: *const SignalAction,
    old_action: *mut SignalAction
) -> isize
\ No newline at end of file diff --git a/ch7/os/syscall/process/fn.sys_sigreturn.html b/ch7/os/syscall/process/fn.sys_sigreturn.html index 7a5c4621..4e5c1b25 100644 --- a/ch7/os/syscall/process/fn.sys_sigreturn.html +++ b/ch7/os/syscall/process/fn.sys_sigreturn.html @@ -1 +1 @@ -sys_sigreturn in os::syscall::process - Rust
pub fn sys_sigreturn() -> isize
\ No newline at end of file +sys_sigreturn in os::syscall::process - Rust
pub fn sys_sigreturn() -> isize
\ No newline at end of file diff --git a/ch7/os/syscall/process/index.html b/ch7/os/syscall/process/index.html index 06c2fe74..2aa0984c 100644 --- a/ch7/os/syscall/process/index.html +++ b/ch7/os/syscall/process/index.html @@ -1,3 +1,3 @@ -os::syscall::process - Rust

Functions

If there is not a child process whose pid is same as given, return -1. +os::syscall::process - Rust

Functions

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.

\ No newline at end of file diff --git a/ch7/src/os/syscall/process.rs.html b/ch7/src/os/syscall/process.rs.html index 8891b5de..5b92fd06 100644 --- a/ch7/src/os/syscall/process.rs.html +++ b/ch7/src/os/syscall/process.rs.html @@ -185,6 +185,9 @@ 185 186 187 +188 +189 +190
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
     }