1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use arceos_posix_api::{sys_exit, sys_getpid};
use core::ffi::c_int;

/// Get current thread ID.
#[no_mangle]
pub unsafe extern "C" fn getpid() -> c_int {
    sys_getpid()
}

/// Abort the current process.
#[no_mangle]
pub unsafe extern "C" fn abort() -> ! {
    panic!()
}

/// Exits the current thread.
#[no_mangle]
pub unsafe extern "C" fn exit(exit_code: c_int) -> ! {
    sys_exit(exit_code)
}