mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
17
kernel/src/syscall/exit.rs
Normal file
17
kernel/src/syscall/exit.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::{
|
||||
prelude::*,
|
||||
process::{posix_thread::do_exit, TermStatus},
|
||||
syscall::SyscallReturn,
|
||||
};
|
||||
|
||||
pub fn sys_exit(exit_code: i32, _ctx: &Context) -> Result<SyscallReturn> {
|
||||
debug!("exid code = {}", exit_code);
|
||||
|
||||
let current_thread = current_thread!();
|
||||
let term_status = TermStatus::Exited(exit_code as _);
|
||||
do_exit(current_thread, term_status)?;
|
||||
|
||||
Ok(SyscallReturn::Return(0))
|
||||
}
|
Reference in New Issue
Block a user