File: mynode.c

package info (click to toggle)
numactl 2.0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,228 kB
  • sloc: ansic: 7,295; sh: 460; makefile: 123; awk: 26
file content (15 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (3)
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;
}