note a leak that needs fixing eventually
[trinity.git] / syscalls / dup3.c
blobbd1ed687e0c8d4b7fe1c6734554733c8b19fc4b8
1 /*
2 * SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
4 * On success, returns the new descriptor.
5 * On error, -1 is returned, and errno is set appropriately.
6 */
8 #include <unistd.h>
9 #include <fcntl.h>
10 #include "sanitise.h"
11 #include "compat.h"
13 struct syscallentry syscall_dup3 = {
14 .name = "dup3",
15 .num_args = 3,
16 .arg1name = "oldfd",
17 .arg1type = ARG_FD,
18 .arg2name = "newfd",
19 .arg2type = ARG_FD,
20 .arg3name = "flags",
21 .arg3type = ARG_LIST,
22 .arg3list = {
23 .num = 1,
24 .values = { O_CLOEXEC },
26 .rettype = RET_FD,
27 .flags = NEED_ALARM,