@@ -3,6 +3,8 @@ use rustc_span::Symbol;
3
3
use rustc_target:: callconv:: { Conv , FnAbi } ;
4
4
5
5
use crate :: shims:: unix:: foreign_items:: EvalContextExt as _;
6
+ use crate :: shims:: unix:: linux_like:: epoll:: EvalContextExt as _;
7
+ use crate :: shims:: unix:: linux_like:: eventfd:: EvalContextExt as _;
6
8
use crate :: shims:: unix:: * ;
7
9
use crate :: * ;
8
10
@@ -21,6 +23,32 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
21
23
) -> InterpResult < ' tcx , EmulateItemResult > {
22
24
let this = self . eval_context_mut ( ) ;
23
25
match link_name. as_str ( ) {
26
+ // epoll, eventfd (NOT available on Solaris!)
27
+ "epoll_create1" => {
28
+ this. assert_target_os ( "illumos" , "epoll_create1" ) ;
29
+ let [ flag] = this. check_shim ( abi, Conv :: C , link_name, args) ?;
30
+ let result = this. epoll_create1 ( flag) ?;
31
+ this. write_scalar ( result, dest) ?;
32
+ }
33
+ "epoll_ctl" => {
34
+ this. assert_target_os ( "illumos" , "epoll_ctl" ) ;
35
+ let [ epfd, op, fd, event] = this. check_shim ( abi, Conv :: C , link_name, args) ?;
36
+ let result = this. epoll_ctl ( epfd, op, fd, event) ?;
37
+ this. write_scalar ( result, dest) ?;
38
+ }
39
+ "epoll_wait" => {
40
+ this. assert_target_os ( "illumos" , "epoll_wait" ) ;
41
+ let [ epfd, events, maxevents, timeout] =
42
+ this. check_shim ( abi, Conv :: C , link_name, args) ?;
43
+ this. epoll_wait ( epfd, events, maxevents, timeout, dest) ?;
44
+ }
45
+ "eventfd" => {
46
+ this. assert_target_os ( "illumos" , "eventfd" ) ;
47
+ let [ val, flag] = this. check_shim ( abi, Conv :: C , link_name, args) ?;
48
+ let result = this. eventfd ( val, flag) ?;
49
+ this. write_scalar ( result, dest) ?;
50
+ }
51
+
24
52
// Threading
25
53
"pthread_setname_np" => {
26
54
let [ thread, name] = this. check_shim ( abi, Conv :: C , link_name, args) ?;
0 commit comments