File: mynode.c

package info (click to toggle)
numactl 2.0.5-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 532 kB
  • ctags: 632
  • sloc: ansic: 5,054; sh: 321; makefile: 139; perl: 59
file content (15 lines) | stat: -rw-r--r-- 273 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <numa.h>
#include <numaif.h>
#include <stdio.h>

int main(void)
{
	int nd;
	char *man = numa_alloc(1000); 
	*man = 1;
	if (get_mempolicy(&nd, NULL, 0, man, MPOL_F_NODE|MPOL_F_ADDR) < 0)
		perror("get_mempolicy");
	else
		printf("my node %d\n", nd); 
	return 0;
}