File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/tools/miri/tests/pass-dep/libc Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,13 @@ fn set_small_cpu_mask() {
116
116
assert_eq ! ( err, -1 ) ;
117
117
assert_eq ! ( std:: io:: Error :: last_os_error( ) . kind( ) , std:: io:: ErrorKind :: InvalidInput ) ;
118
118
119
- // any other number of bytes (at least up to `size_of<cpu_set_t>()` will work
120
- for i in 1 ..24 {
119
+ // on LE systems, any other number of bytes (at least up to `size_of<cpu_set_t>()`) will work.
120
+ // on BE systems the CPUs 0..8 are stored in the right-most byte of the first chunk. If that
121
+ // byte is not included, no valid CPUs are configured. We skip those cases.
122
+ let cpu_zero_included_length =
123
+ if cfg ! ( target_endian = "little" ) { 1 } else { core:: mem:: size_of :: < std:: ffi:: c_ulong > ( ) } ;
124
+
125
+ for i in cpu_zero_included_length..24 {
121
126
let err = unsafe { sched_setaffinity ( PID , i, & cpuset) } ;
122
127
assert_eq ! ( err, 0 , "fail for {i}" ) ;
123
128
}
You can’t perform that action at this time.
0 commit comments