move_pages: just use calloc
[trinity.git] / syscalls / mlockall.c
blob73611cd71ba470484863dd0eda52ecd24fce79f7
1 /*
2 * SYSCALL_DEFINE1(mlockall, int, flags)
3 */
4 #include <stdlib.h>
5 #include "sanitise.h"
6 #include "random.h"
7 #include "shm.h"
9 #define MCL_CURRENT 1
10 #define MCL_FUTURE 2
12 static void sanitise_mlockall(int childno)
14 if (shm->syscall[childno].a1 != 0)
15 return;
17 if (rand_bool())
18 shm->syscall[childno].a1 = MCL_CURRENT;
19 else
20 shm->syscall[childno].a1 = MCL_FUTURE;
24 struct syscallentry syscall_mlockall = {
25 .name = "mlockall",
26 .num_args = 1,
27 .arg1name = "flags",
28 .arg1type = ARG_LIST,
29 .arg1list = {
30 .num = 2,
31 .values = { MCL_CURRENT, MCL_FUTURE },
33 .group = GROUP_VM,
34 .sanitise = sanitise_mlockall,