-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The shim syscall logic doesn't support ID 290, SYS_eventfd2.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/tools/miri/tests/fail-dep/libc/libc_syscall_eventfd2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@only-target: linux | ||
|
||
// This is a test for calling eventfd2 through a syscall. | ||
// But we do not support this. | ||
fn main() { | ||
let initval = 0 as libc::c_uint; | ||
let flags = (libc::EFD_CLOEXEC | libc::EFD_NONBLOCK) as libc::c_int; | ||
|
||
let result = unsafe { | ||
libc::syscall(libc::SYS_eventfd2, initval, flags) //~ERROR: unsupported operation | ||
}; | ||
|
||
assert_eq!(result, 3); // The first FD provided would be 3. | ||
} |
15 changes: 15 additions & 0 deletions
15
src/tools/miri/tests/fail-dep/libc/libc_syscall_eventfd2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error: unsupported operation: can't execute syscall with ID 290 | ||
--> tests/fail-dep/libc/libc_syscall_eventfd2.rs:LL:CC | ||
| | ||
LL | libc::syscall(libc::SYS_eventfd2, initval, flags) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't execute syscall with ID 290 | ||
| | ||
= help: if this is a basic API commonly used on this target, please report an issue with Miri | ||
= help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases | ||
= note: BACKTRACE: | ||
= note: inside `main` at tests/fail-dep/libc/libc_syscall_eventfd2.rs:LL:CC | ||
|
||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | ||
|
||
error: aborting due to 1 previous error | ||
|