note a leak that needs fixing eventually
[trinity.git] / syscalls / recv.c
blob750660d3f4b1212e0f7dacf809a7e279830cd343
1 /*
2 asmlinkage long sys_recv(int fd, void __user *ubuf, size_t size,
3 unsigned flags)
5 */
6 #include <sys/types.h>
7 #include <sys/socket.h>
8 #include "compat.h"
9 #include "sanitise.h"
11 struct syscallentry syscall_recv = {
12 .name = "recv",
13 .num_args = 4,
14 .arg1name = "fd",
15 .arg1type = ARG_FD,
16 .arg2name = "ubuf",
17 .arg2type = ARG_ADDRESS,
18 .arg3name = "size",
19 .arg3type = ARG_LEN,
20 .arg4name = "flags",
21 .arg4type = ARG_LIST,
22 .arg4list = {
23 .num = 20,
24 .values = { MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
25 MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR,
26 MSG_WAITALL, MSG_FIN, MSG_SYN, MSG_CONFIRM,
27 MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
28 MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC, MSG_CMSG_COMPAT },
30 .flags = NEED_ALARM,
35 * SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
36 unsigned, flags, struct sockaddr __user *, addr,
37 int __user *, addr_len)
39 struct syscallentry syscall_recvfrom = {
40 .name = "recvfrom",
41 .num_args = 6,
42 .arg1name = "fd",
43 .arg1type = ARG_FD,
44 .arg2name = "ubuf",
45 .arg2type = ARG_ADDRESS,
46 .arg3name = "size",
47 .arg3type = ARG_LEN,
48 .arg4name = "flags",
49 .arg4type = ARG_LIST,
50 .arg4list = {
51 .num = 20,
52 .values = { MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
53 MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR,
54 MSG_WAITALL, MSG_FIN, MSG_SYN, MSG_CONFIRM,
55 MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
56 MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC, MSG_CMSG_COMPAT },
58 .arg5name = "addr",
59 .arg5type = ARG_SOCKADDR,
60 .arg6name = "addr_len",
61 .arg6type = ARG_SOCKADDRLEN,
62 .flags = NEED_ALARM,
67 * SYSCALL_DEFINE3(recvmsg, int, fd, struct msghdr __user *, msg, unsigned int, flags)
69 struct syscallentry syscall_recvmsg = {
70 .name = "recvmsg",
71 .num_args = 3,
72 .arg1name = "fd",
73 .arg1type = ARG_FD,
74 .arg2name = "msg",
75 .arg2type = ARG_ADDRESS,
76 .arg3name = "flags",
77 .arg3type = ARG_LIST,
78 .arg3list = {
79 .num = 20,
80 .values = { MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
81 MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR,
82 MSG_WAITALL, MSG_FIN, MSG_SYN, MSG_CONFIRM,
83 MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
84 MSG_WAITFORONE, MSG_CMSG_CLOEXEC, MSG_FASTOPEN, MSG_CMSG_COMPAT },
86 .flags = NEED_ALARM,
90 * SYSCALL_DEFINE5(recvmmsg, int, fd, struct mmsghdr __user *, mmsg,
91 unsigned int, vlen, unsigned int, flags,
92 struct timespec __user *, timeout)
94 struct syscallentry syscall_recvmmsg = {
95 .name = "recvmmsg",
96 .num_args = 5,
97 .arg1name = "fd",
98 .arg1type = ARG_FD,
99 .arg2name = "mmsg",
100 .arg2type = ARG_ADDRESS,
101 .arg3name = "vlen",
102 .arg3type = ARG_LEN,
103 .arg4name = "flags",
104 .arg4type = ARG_LIST,
105 .arg4list = {
106 .num = 20,
107 .values = { MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC,
108 MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR,
109 MSG_WAITALL, MSG_FIN, MSG_SYN, MSG_CONFIRM,
110 MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE,
111 MSG_WAITFORONE, MSG_CMSG_CLOEXEC, MSG_FASTOPEN, MSG_CMSG_COMPAT },
113 .arg5name = "timeout",
114 .arg5type = ARG_ADDRESS,
115 .flags = NEED_ALARM,