> +#define BITS_PER_BYTE 8 > +int get_max_cpu(void) > +{ > + int max = 0; > + int index; > + cpu_set_t mask; > + if( numa_sched_getaffinity(0, sizeof(cpu_set_t), &mask) < 0 ){ > + perror("numa_sched_getaffinity:"); Ah noticed another problem. Please don't rely on the glibc cpuset_t, there's no guarantee it's big enough. In fact libnuma.c already has code for this in set_numa_max_cpu(). Please reuse that. Just make sure you don't create a backdoor interface into libnuma. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-numa" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html