Back to index

glibc  2.9
Defines | Functions
tst-cpucount.c File Reference
#include <sched.h>
#include <stdio.h>
#include "../test-skeleton.c"

Go to the source code of this file.

Defines

#define TEST_FUNCTION   do_test ()

Functions

static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 26 of file tst-cpucount.c.


Function Documentation

static int do_test ( void  ) [static]

Definition at line 5 of file tst-cpucount.c.

{
  cpu_set_t c;

  CPU_ZERO (&c);

  for (int cnt = 0; cnt < 130; ++cnt)
    {
      int n = CPU_COUNT (&c);
      if (n != cnt)
       {
         printf ("expected %d, not %d\n", cnt, n);
         return 1;
       }

      CPU_SET (cnt, &c);
    }

  return 0;
}

Here is the call graph for this function: