hsbench: cpuset portability

This commit is contained in:
Matthew Barr 2017-06-14 12:58:51 +10:00
parent 79b42cff58
commit f739314696

View File

@ -125,10 +125,10 @@ public:
// Apply processor affinity (if available) to this thread.
bool affine(UNUSED int cpu) {
#ifdef HAVE_DECL_PTHREAD_SETAFFINITY_NP
#if defined(__linux__)
cpu_set_t cpuset;
#else // BSD
#if defined(__FreeBSD__)
cpuset_t cpuset;
#else
cpu_set_t cpuset;
#endif
CPU_ZERO(&cpuset);
assert(cpu >= 0 && cpu < CPU_SETSIZE);