summarylogtreecommitdiffstats
path: root/0003-Revert-linux-user-Use-safe_syscall-wrapper-for-send-.patch
blob: 70cf1ddca2f8ffaf7bc28cf21d52eb005b161a29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Frajo Haider <f_haider@gmx.at>
Date: Wed, 22 Jan 2020 10:57:53 +0200
Subject: [PATCH] Revert "linux-user: Use safe_syscall wrapper for send* and
 recv* syscalls"

This reverts commit 666875306e03e1f94e1d4c808502585c10abc69a.
---
 linux-user/syscall.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 56310dd38dcffba5b846e36af03e6beb5dd006eb..af8ce5b4bd67490459dfcf12e28e3a42eb5771cd 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -674,14 +674,6 @@ safe_syscall5(ssize_t, preadv, int, fd, const struct iovec *, iov, int, iovcnt,
               unsigned long, pos_l, unsigned long, pos_h)
 safe_syscall5(ssize_t, pwritev, int, fd, const struct iovec *, iov, int, iovcnt,
               unsigned long, pos_l, unsigned long, pos_h)
-safe_syscall3(int, connect, int, fd, const struct sockaddr *, addr,
-              socklen_t, addrlen)
-safe_syscall6(ssize_t, sendto, int, fd, const void *, buf, size_t, len,
-              int, flags, const struct sockaddr *, addr, socklen_t, addrlen)
-safe_syscall6(ssize_t, recvfrom, int, fd, void *, buf, size_t, len,
-              int, flags, struct sockaddr *, addr, socklen_t *, addrlen)
-safe_syscall3(ssize_t, sendmsg, int, fd, const struct msghdr *, msg, int, flags)
-safe_syscall3(ssize_t, recvmsg, int, fd, struct msghdr *, msg, int, flags)
 safe_syscall2(int, flock, int, fd, int, operation)
 #if defined(TARGET_NR_rt_sigtimedwait) || defined(TARGET_NR_rt_sigtimedwait_time64)
 safe_syscall4(int, rt_sigtimedwait, const sigset_t *, these, siginfo_t *, uinfo,
@@ -3290,17 +3282,17 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
                                                    msg.msg_iov->iov_len);
             if (ret >= 0) {
                 msg.msg_iov->iov_base = host_msg;
-                ret = get_errno(safe_sendmsg(fd, &msg, flags));
+                ret = get_errno(sendmsg(fd, &msg, flags));
             }
             g_free(host_msg);
         } else {
             ret = target_to_host_cmsg(&msg, msgp);
             if (ret == 0) {
-                ret = get_errno(safe_sendmsg(fd, &msg, flags));
+                ret = get_errno(sendmsg(fd, &msg, flags));
             }
         }
     } else {
-        ret = get_errno(safe_recvmsg(fd, &msg, flags));
+        ret = get_errno(recvmsg(fd, &msg, flags));
         if (!is_error(ret)) {
             len = ret;
             if (fd_trans_host_to_target_data(fd)) {
@@ -3548,9 +3540,9 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
         if (ret) {
             goto fail;
         }
-        ret = get_errno(safe_sendto(fd, host_msg, len, flags, addr, addrlen));
+        ret = get_errno(sendto(fd, host_msg, len, flags, addr, addrlen));
     } else {
-        ret = get_errno(safe_sendto(fd, host_msg, len, flags, NULL, 0));
+        ret = get_errno(send(fd, host_msg, len, flags));
     }
 fail:
     if (copy_msg) {
@@ -3590,12 +3582,12 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags,
         }
         addr = alloca(addrlen);
         ret_addrlen = addrlen;
-        ret = get_errno(safe_recvfrom(fd, host_msg, len, flags,
+        ret = get_errno(recvfrom(fd, host_msg, len, flags,
                                       addr, &ret_addrlen));
     } else {
         addr = NULL; /* To keep compiler quiet.  */
         addrlen = 0; /* To keep compiler quiet.  */
-        ret = get_errno(safe_recvfrom(fd, host_msg, len, flags, NULL, 0));
+        ret = get_errno(recvfrom(fd, host_msg, len, flags, NULL, 0));
     }
     if (!is_error(ret)) {
         if (fd_trans_host_to_target_data(fd)) {