~ubuntu-branches/ubuntu/vivid/numactl/vivid-updates

« back to all changes in this revision

Viewing changes to util.c

  • Committer: Package Import Robot
  • Author(s): Ian Wienand
  • Date: 2014-09-09 21:33:32 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20140909213332-ph3qt0yq2ffozuky
Tags: 2.0.10~rc2-1
* Upgrade to 2.0.10-rc2
* Remove 001_no_numa.patch; fixed upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "numa.h"
17
17
#include "numaif.h"
18
18
#include "util.h"
19
 
#include "bitops.h"
20
19
#include <stdio.h>
21
20
#include <string.h>
22
21
#include <stdlib.h>
28
27
void printmask(char *name, struct bitmask *mask)
29
28
{
30
29
        int i;
31
 
 
32
30
        printf("%s: ", name);
33
 
        for (i = 0; i <= mask->size; i++)
 
31
        for (i = 0; i < mask->size; i++)
34
32
                if (numa_bitmask_isbitset(mask, i))
35
33
                        printf("%d ", i);
36
34
        putchar('\n');
37
35
}
38
36
 
39
 
void printcpumask(char *name, struct bitmask *mask)
 
37
int find_first(struct bitmask *mask)
40
38
{
41
39
        int i;
42
 
        printf("%s: ", name);
43
 
        for (i = 0; i < mask->size; i++) {
 
40
        for (i = 0; i < mask->size; i++)
44
41
                if (numa_bitmask_isbitset(mask, i))
45
 
                        printf("%d ", i);
46
 
        }
47
 
        putchar('\n');
 
42
                        return i;
 
43
        return -1;
48
44
}
49
45
 
50
46
void complain(char *fmt, ...)