use rawsys_linux;
#[test]
fn invalid_syscall_returns_enosys() {
let invalid_id = rawsys_linux::Sysno::last().id() + 100;
let ret = unsafe {
rawsys_linux::raw::syscall0(invalid_id as rawsys_linux::SyscallWord)
};
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
let res = rawsys_linux::Errno::from_ret_u64(ret as u64);
#[cfg(all(
not(all(target_arch = "x86_64", target_pointer_width = "32")),
target_pointer_width = "64"
))]
let res = rawsys_linux::Errno::from_ret_u64(ret as u64);
#[cfg(all(
not(all(target_arch = "x86_64", target_pointer_width = "32")),
target_pointer_width = "32"
))]
let res = rawsys_linux::Errno::from_ret_u32(ret as u32);
assert_eq!(res, Err(rawsys_linux::Errno::ENOSYS));
}