[msan][test] Fix cpusetsize for another pthread_getaffinity_np.cpp test

Similar to D127368
This commit is contained in:
Fangrui Song 2022-06-08 20:08:05 -07:00
parent 2ae52326da
commit 62309ed955
2 changed files with 3 additions and 7 deletions

View File

@ -6,10 +6,10 @@
#include <sanitizer/msan_interface.h>
int main() {
cpu_set_t set_x;
int res = pthread_getaffinity_np(pthread_self(), sizeof(set_x), &set_x);
cpu_set_t set_x[4];
int res = pthread_getaffinity_np(pthread_self(), sizeof(set_x), set_x);
assert(res == 0);
__msan_check_mem_is_initialized(&set_x, sizeof(set_x));
__msan_check_mem_is_initialized(set_x, sizeof(set_x));
return 0;
}

View File

@ -5,10 +5,6 @@
// sched_getaffinity).
// UNSUPPORTED: android
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <assert.h>
#include <pthread.h>
#include <sys/sysinfo.h>