- /* Verify the thread's cpu-affinity */
- ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t),
- &cpuset);
- if (ret) {
- error(0, ret, "pthread_getaffinity_np()");
- kfree(q_pcfg);
- return NULL;
- }
-
- q_pcfg->cpu = -1;
- for (loop = 0; loop < CPU_SETSIZE; loop++)
- if (CPU_ISSET(loop, &cpuset)) {
- if (q_pcfg->cpu != -1) {
- pr_err("Thread is not affine to 1 cpu\n");
- kfree(q_pcfg);
- return NULL;
- }
- q_pcfg->cpu = loop;
- }
- if (q_pcfg->cpu == -1) {
- pr_err("Bug in getaffinity handling!\n");
- kfree(q_pcfg);
- return NULL;
- }
-