10 if (sched_getaffinity (getpid (), sizeof (cs
), &cs
) != 0)
12 printf ("getaffinity failed: %m\n");
18 while (CPU_COUNT (&cs
) != 0)
20 if (CPU_ISSET (cpu
, &cs
))
25 if (sched_setaffinity (getpid (), sizeof (cs2
), &cs2
) != 0)
27 printf ("setaffinity(%d) failed: %m\n", cpu
);
32 int cpu2
= sched_getcpu ();
33 if (cpu2
== -1 && errno
== ENOSYS
)
35 puts ("getcpu syscall not implemented");
40 printf ("getcpu results %d not possible\n", cpu2
);
52 #define TEST_FUNCTION do_test ()
53 #include <test-skeleton.c>