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