File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,8 @@ case $HOST_TARGET in
148
148
UNIX=" panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
149
149
TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs
150
150
TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC $UNIX threadname libc-time fs
151
- TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread-sync libc-time
152
- TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread-sync libc-time
151
+ TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time
152
+ TEST_TARGET=x86_64-pc-solaris run_tests_minimal $BASIC $UNIX threadname pthread-sync available-parallelism libc-time
153
153
TEST_TARGET=aarch64-linux-android run_tests_minimal $BASIC $UNIX
154
154
TEST_TARGET=wasm32-wasip2 run_tests_minimal empty_main wasm heap_alloc libc-mem
155
155
TEST_TARGET=wasm32-unknown-unknown run_tests_minimal empty_main wasm
Original file line number Diff line number Diff line change @@ -69,6 +69,36 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
69
69
this. write_null ( dest) ?;
70
70
}
71
71
72
+ "pset_info" => {
73
+ let [ pset, tpe, cpus, list] =
74
+ this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
75
+ // We do not need to handle the current process cpu mask, available_parallelism
76
+ // implementation pass null anyway. We only care for the number of
77
+ // cpus.
78
+ // https://docs.oracle.com/cd/E88353_01/html/E37841/pset-info-2.html
79
+
80
+ let ps_myid = this. eval_libc_i32 ( "PS_MYID" ) ;
81
+ let pset = this. read_scalar ( pset) ?. to_i32 ( ) ?;
82
+ let tpe = this. read_pointer ( tpe) ?;
83
+ let list = this. read_pointer ( list) ?;
84
+
85
+ if ps_myid != pset {
86
+ throw_unsup_format ! ( "pset_info is only supported with pset==PS_MYID" ) ;
87
+ }
88
+
89
+ if !this. ptr_is_null ( tpe) ? {
90
+ throw_unsup_format ! ( "pset_info is only supported with type==NULL" ) ;
91
+ }
92
+
93
+ if !this. ptr_is_null ( list) ? {
94
+ throw_unsup_format ! ( "pset_info is only supported with list==NULL" ) ;
95
+ }
96
+
97
+ let cpus = this. deref_pointer ( cpus) ?;
98
+ this. write_scalar ( Scalar :: from_u32 ( this. machine . num_cpus ) , & cpus) ?;
99
+ this. write_null ( dest) ?;
100
+ }
101
+
72
102
_ => return Ok ( EmulateItemResult :: NotSupported ) ,
73
103
}
74
104
Ok ( EmulateItemResult :: NeedsReturn )
You can’t perform that action at this time.
0 commit comments