axlibc/
unistd.rs

1use arceos_posix_api::{sys_exit, sys_getpid};
2use core::ffi::c_int;
3
4/// Get current thread ID.
5#[unsafe(no_mangle)]
6pub unsafe extern "C" fn getpid() -> c_int {
7    sys_getpid()
8}
9
10/// Abort the current process.
11#[unsafe(no_mangle)]
12pub unsafe extern "C" fn abort() -> ! {
13    panic!()
14}
15
16/// Exits the current thread.
17#[unsafe(no_mangle)]
18pub unsafe extern "C" fn exit(exit_code: c_int) -> ! {
19    sys_exit(exit_code)
20}