add new renameat2 syscall
[trinity.git] / syscalls / vmsplice.c
blob8156e4de1539d9aebe5ab784085bd69dd8e4f565
1 /*
2 * SYSCALL_DEFINE4(vmsplice, int, fd, const struct iovec __user *, iov,
3 unsigned long, nr_segs, unsigned int, flags)
4 */
6 #include <fcntl.h>
7 #include <sys/uio.h>
8 #include <stdlib.h>
9 #include "sanitise.h"
10 #include "shm.h"
12 static void sanitise_vmsplice(int childno)
14 if ((rand() % 10) > 0)
15 shm->syscall[childno].a1 = shm->pipe_fds[rand() % MAX_PIPE_FDS];
16 shm->syscall[childno].a3 = rand() % UIO_MAXIOV;
19 struct syscallentry syscall_vmsplice = {
20 .name = "vmsplice",
21 .num_args = 4,
22 .sanitise = sanitise_vmsplice,
23 .arg1name = "fd",
24 .arg1type = ARG_FD,
25 .arg2name = "iov",
26 .arg2type = ARG_IOVEC,
27 .arg3name = "nr_segs",
28 .arg3type = ARG_IOVECLEN,
29 .arg4name = "flags",
30 .arg4type = ARG_LIST,
31 .arg4list = {
32 .num = 4,
33 .values = { SPLICE_F_MOVE, SPLICE_F_NONBLOCK, SPLICE_F_MORE, SPLICE_F_GIFT },
35 .group = GROUP_VM,
36 .flags = NEED_ALARM,