note a leak that needs fixing eventually
[trinity.git] / syscalls / rename.c
blobd2fa7bc0f23f80c4988b1197f3b9365064411fdd
1 /*
2 * SYSCALL_DEFINE2(rename, const char __user *, oldname, const char __user *, newname
3 */
4 #include "sanitise.h"
6 struct syscallentry syscall_rename = {
7 .name = "rename",
8 .num_args = 2,
9 .arg1name = "oldname",
10 .arg1type = ARG_ADDRESS,
11 .arg2name = "newname",
12 .arg2type = ARG_ADDRESS,
13 .group = GROUP_VFS,
17 * SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
18 int, newdfd, const char __user *, newname)
21 struct syscallentry syscall_renameat = {
22 .name = "renameat",
23 .num_args = 4,
24 .arg1name = "olddfd",
25 .arg1type = ARG_FD,
26 .arg2name = "oldname",
27 .arg2type = ARG_ADDRESS,
28 .arg3name = "newdfd",
29 .arg3type = ARG_FD,
30 .arg4name = "newname",
31 .arg4type = ARG_ADDRESS,
32 .flags = NEED_ALARM,
33 .group = GROUP_VFS,
37 * SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
38 int, newdfd, const char __user *, newname, unsigned int, flags)
41 #define RENAME_NOREPLACE (1 << 0) /* Don't overwrite target */
42 #define RENAME_EXCHANGE (1 << 1) /* Exchange source and dest */
44 struct syscallentry syscall_renameat2 = {
45 .name = "renameat2",
46 .num_args = 5,
47 .arg1name = "olddfd",
48 .arg1type = ARG_FD,
49 .arg2name = "oldname",
50 .arg2type = ARG_ADDRESS,
51 .arg3name = "newdfd",
52 .arg3type = ARG_FD,
53 .arg4name = "newname",
54 .arg4type = ARG_ADDRESS,
55 .arg5name = "flags",
56 .arg5type = ARG_LIST,
57 .arg5list = {
58 .num = 2,
59 .values = { RENAME_NOREPLACE, RENAME_EXCHANGE },
61 .flags = NEED_ALARM,
62 .group = GROUP_VFS,