2007-04-04 01:29:18 +02:00
|
|
|
#include <sched.h>
|
|
|
|
#include <stdio.h>
|
2009-06-16 06:12:57 +02:00
|
|
|
#include <sys/param.h>
|
2007-04-04 01:29:18 +02:00
|
|
|
|
|
|
|
static int
|
|
|
|
do_test (void)
|
|
|
|
{
|
|
|
|
cpu_set_t c;
|
|
|
|
|
|
|
|
CPU_ZERO (&c);
|
|
|
|
|
2009-06-16 06:12:57 +02:00
|
|
|
for (int cnt = 0; cnt < MIN (CPU_SETSIZE, 130); ++cnt)
|
2007-04-04 01:29:18 +02:00
|
|
|
{
|
|
|
|
int n = CPU_COUNT (&c);
|
|
|
|
if (n != cnt)
|
|
|
|
{
|
|
|
|
printf ("expected %d, not %d\n", cnt, n);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
CPU_SET (cnt, &c);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TEST_FUNCTION do_test ()
|
|
|
|
#include "../test-skeleton.c"
|