{
#ifdef HAVE_SCHED_GETAFFINITY
#ifdef __FreeBSD__
cpuset_t affinity;
#else
cpu_set_t affinity;
#endif
int i, cpu_count;
if (sched_getaffinity(0, sizeof(affinity), &affinity)) {