yac
/
coreutils
Archived
2
0
Fork 0
This repository has been archived on 2024-01-01. You can view files and clone it, but cannot push or open issues or pull requests.
coreutils/src/bin/true.rs

23 lines
495 B
Rust

// Copyright (c) 2022 silt <silt@tebibyte.media>
// SPDX-License-Identifier: AGPL-3.0-or-later
#![feature(lang_items, start)]
#![no_main]
#![no_std]
use core::panic::PanicInfo;
use core::arch::asm;
#[lang = "eh_personality"] extern fn rust_eh_personality() {}
#[lang = "panic_impl"] extern fn rust_begin_panic(_: &PanicInfo) -> ! { loop {} }
#[no_mangle]
pub unsafe fn _start() -> ! {
asm!(
"syscall",
in("rax") 60, // Syscall number
in("rdi") 0, // Exit code
options(noreturn)
)
}