add new renameat2 syscall
[trinity.git] / syscalls / linkat.c
blob9922c7b02e497ee93fe29da60833212111708906
1 /*
2 * SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
3 int, newdfd, const char __user *, newname, int, flags)
4 */
5 #include <fcntl.h>
6 #include <stdlib.h>
7 #include "shm.h"
8 #include "sanitise.h"
9 #include "compat.h"
11 static void sanitise_linkat(int childno)
13 /* .. If oldpath is relative and olddirfd is the special value AT_FDCWD, then oldpath is
14 * interpreted relative to the current working directory of the calling process */
15 if ((rand() % 100) == 0)
16 shm->syscall[childno].a1 = AT_FDCWD;
19 struct syscallentry syscall_linkat = {
20 .name = "linkat",
21 .num_args = 5,
22 .arg1name = "olddfd",
23 .arg1type = ARG_FD,
24 .arg2name = "oldname",
25 .arg2type = ARG_PATHNAME,
26 .arg3name = "newdfd",
27 .arg3type = ARG_FD,
28 .arg4name = "newname",
29 .arg4type = ARG_PATHNAME,
30 .arg5name = "flags",
31 .arg5type = ARG_LIST,
32 .arg5list = {
33 .num = 2,
34 .values = { AT_SYMLINK_FOLLOW , AT_EMPTY_PATH },
36 .flags = NEED_ALARM,
37 .group = GROUP_VFS,
38 .sanitise = sanitise_linkat,