Macro syscalls::raw_syscall
source · macro_rules! raw_syscall { ($nr:expr) => { ... }; ($nr:expr, $a1:expr) => { ... }; ($nr:expr, $a1:expr, $a2:expr) => { ... }; ($nr:expr, $a1:expr, $a2:expr, $a3:expr) => { ... }; ($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr) => { ... }; ($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr, $a5:expr) => { ... }; ($nr:expr, $a1:expr, $a2:expr, $a3:expr, $a4:expr, $a5:expr, $a6:expr) => { ... }; }
Expand description
Performs a raw syscall and returns a usize
. Use syscall
if you wish to
get a Result
as a return value.
Accepts a syscall number and a variable number of arguments (0 to 6).
§Example
use syscalls::{Sysno, raw_syscall};
// gettid is guaranteed to never fail, so we don't need a `Result` return
// value.
let tid = unsafe { raw_syscall!(Sysno::gettid) };
println!("My thread ID is {}", tid);