forked from AbleOS/ableos
37 lines
621 B
Rust
37 lines
621 B
Rust
#![no_std]
|
|
#![no_main]
|
|
|
|
#[no_mangle]
|
|
fn start() -> i32 {
|
|
let ret = unsafe { add(1, 2) };
|
|
unsafe {
|
|
send_signal(PID(1), Signals::Quit);
|
|
}
|
|
|
|
ret as i32
|
|
}
|
|
|
|
extern "C" {
|
|
|
|
/// Send a signal to a process
|
|
///
|
|
/// # Arguments
|
|
///
|
|
/// * `pid` - The PID of the process to send the signal to
|
|
/// * `signal` - The signal to send
|
|
pub fn send_signal(pid: PID, signal: Signals) -> bool;
|
|
}
|
|
|
|
use {
|
|
libwasm::process::{signals::Signals, PID},
|
|
libwasm::syscalls::add,
|
|
};
|
|
|
|
use libwasm::*;
|
|
|
|
#[panic_handler]
|
|
fn panic(_info: &PanicInfo) -> ! {
|
|
loop {}
|
|
}
|
|
use core::panic::PanicInfo;
|