#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
unsafe fn write(fd: u32, buf: &[u8]) -> isize {
let mut ret;
unsafe {
asm!(
"syscall",
in("rax") 1u32,
in("rdi") fd,
in("rsi") buf.as_ptr(),
in("rdx") buf.len(),
lateout("rax") ret,
out("rcx") _,
out("r11") _,
options(nostack, readonly)
);
}
ret
}
Cniles somehow think this is bad.