Stub `kernel_version` for tests

pull/107/head
Dan Everton 3 years ago
parent d966881e46
commit 49f6a8e819
No known key found for this signature in database
GPG Key ID: 2AF33A2B189A11B3

@ -75,6 +75,12 @@ unsafe fn syscall_impl(call: Syscall) -> SysResult {
Ok(ret)
}
#[cfg(test)]
pub(crate) fn kernel_version() -> Result<(u32, u32, u32), ()> {
return Ok((0xff, 0xff, 0xff))
}
#[cfg(not(test))]
pub(crate) fn kernel_version() -> Result<(u32, u32, u32), ()> {
unsafe {
let mut v = mem::zeroed::<utsname>();

Loading…
Cancel
Save