1 #include "tests.h"
2 #include <asm/unistd.h>
3 
4 #if defined __NR_mlock && defined __NR_munlock
5 
6 # include <stdio.h>
7 # include <unistd.h>
8 
9 int
10 main(void)
11 {
12 	const int size = 1024;
13 	const char *addr = tail_alloc(size);
14 
15 	long rc = syscall(__NR_mlock, addr, size);
16 	printf("mlock(%p, %d) = %s\n", addr, size, sprintrc(rc));
17 
18 	rc = syscall(__NR_munlock, addr, size);
19 	printf("munlock(%p, %d) = %s\n", addr, size, sprintrc(rc));
20 
21 	puts("+++ exited with 0 +++");
22 	return 0;
23 }
24 
25 #else
26 
27 SKIP_MAIN_UNDEFINED("__NR_mlock && __NR_munlock")
28 
29 #endif
30