[go: up one dir, main page]

File: mlockall.c

package info (click to toggle)
trinity 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,252 kB
  • ctags: 2,738
  • sloc: ansic: 24,011; sh: 322; makefile: 141
file content (35 lines) | stat: -rw-r--r-- 605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * SYSCALL_DEFINE1(mlockall, int, flags)
 */
#include <stdlib.h>
#include "sanitise.h"
#include "random.h"
#include "shm.h"

#define MCL_CURRENT     1
#define MCL_FUTURE      2

static void sanitise_mlockall(int childno)
{
	if (shm->a1[childno] != 0)
		return;

	if (rand_bool())
		shm->a1[childno] = MCL_CURRENT;
	else
		shm->a1[childno] = MCL_FUTURE;
}


struct syscall syscall_mlockall = {
	.name = "mlockall",
	.num_args = 1,
	.arg1name = "flags",
	.arg1type = ARG_LIST,
	.arg1list = {
		.num = 2,
		.values = { MCL_CURRENT, MCL_FUTURE },
	},
	.group = GROUP_VM,
	.sanitise = sanitise_mlockall,
};