yaoi 0.0.0-scratch0

yaws io_uring I/O
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Yaoi Macros

use crate::error::YaoiError;

/// Helper macro to execute a system call
macro_rules! syscall {
    ($fn: ident ( $($arg: expr),* $(,)* ) ) => {{
        #[allow(unused_unsafe)]
        let res = unsafe { libc::$fn($($arg, )*) };
        if res == -1 {
            Err(YaoiError::StdIo(std::io::Error::last_os_error()))
        } else {
            Ok(res)
        }
    }};
}