File: mynode.c

package info (click to toggle)
numactl 2.0.11-2.1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,912 kB
  • ctags: 922
  • sloc: sh: 11,860; ansic: 6,542; makefile: 104
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;
}