diff --git a/tests/test.rs b/tests/test.rs index 8ed7c37..ca8859b 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -10,6 +10,17 @@ #[macro_use] extern crate sc; +#[cfg(target_os = "linux")] +#[test] +fn ebadf() { + static MESSAGE: &'static str = "Hello, world!"; + + unsafe { + assert_eq!(syscall!(WRITE, 4, MESSAGE.as_ptr(), MESSAGE.len()) as isize, + -9) + } +} + // getpid() is POSIX but that doesn't guarantee it's a system call. #[cfg(any(target_os = "linux", target_os = "freebsd"))] #[test]