release_process_vm: free vm_range_numa_policy
Change-Id: I8084cd60a12b557b635b8e350f70d4e4f95d4c52 Refs: #1101
This commit is contained in:
committed by
Masamichi Takagi
parent
d5de68e97b
commit
1db00ebc04
28
test/issues/1101/C1101T05.c
Normal file
28
test/issues/1101/C1101T05.c
Normal file
@ -0,0 +1,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <numaif.h>
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
void *p;
|
||||
unsigned long mask;
|
||||
|
||||
p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
|
||||
-1, 0);
|
||||
if (p == ((void *)-1)) {
|
||||
perror("mmap");
|
||||
exit(1);
|
||||
}
|
||||
mask = 1;
|
||||
if (mbind(p, 4096, MPOL_PREFERRED, &mask, 2, MPOL_MF_MOVE) == -1) {
|
||||
perror("mbind");
|
||||
exit(1);
|
||||
}
|
||||
munmap(p, 4096);
|
||||
exit(0);
|
||||
}
|
||||
Reference in New Issue
Block a user