split up constants.h some
[trinity.git] / syscalls / msync.c
blobd7bda5e4e1d1a8b297021c0d10daf3a89ef34d32
1 /*
2 * SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
3 */
4 #include "maps.h"
5 #include "random.h"
6 #include "sanitise.h"
7 #include "shm.h"
9 #define MS_ASYNC 1 /* Sync memory asynchronously. */
10 #define MS_SYNC 4 /* Synchronous memory sync. */
11 #define MS_INVALIDATE 2 /* Invalidate the caches. */
13 static void sanitise_msync(int childno)
15 (void) common_set_mmap_ptr_len(childno);
17 if (rand_bool())
18 shm->syscall[childno].a3 |= MS_INVALIDATE;
21 struct syscallentry syscall_msync = {
22 .name = "msync",
23 .num_args = 3,
24 .arg1name = "start",
25 .arg1type = ARG_MMAP,
26 .arg2name = "len",
27 .arg3name = "flags",
28 .arg3type = ARG_OP,
29 .arg3list = {
30 .num = 2,
31 .values = { MS_ASYNC, MS_SYNC },
33 .group = GROUP_VM,
34 .sanitise = sanitise_msync,