Verify current system before continuing.

This commit is contained in:
Jeremy Soller
2019-01-27 15:53:09 -07:00
parent 47235d44e7
commit 42f212e678
4 changed files with 26 additions and 1 deletions
+5
View File
@@ -435,4 +435,9 @@ impl Pal for Sys {
fn write(fildes: c_int, buf: &[u8]) -> ssize_t {
e(unsafe { syscall!(WRITE, fildes, buf.as_ptr(), buf.len()) }) as ssize_t
}
fn verify() -> bool {
// GETPID on Linux is 39, which does not exist on Redox
e(unsafe { sc::syscall5(sc::nr::GETPID, !0, !0, !0, !0, !0) }) != !0
}
}