diff mbox series

[v2,045/108] linux-user: Split out accept, accept4, bind, connect

Message ID 20180610030220.3777-46-richard.henderson@linaro.org
State New
Headers show
Series linux-user: Split do_syscall | expand

Commit Message

Richard Henderson June 10, 2018, 3:01 a.m. UTC
All targets define accept4; remove the ifdef.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/syscall.c | 52 ++++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 16 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d50c84614e..155da4f523 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7730,6 +7730,18 @@  static abi_long impl_##NAME(void *cpu_env, unsigned num, abi_long arg1,   \
                             abi_long arg5, abi_long arg6, abi_long arg7,  \
                             abi_long arg8)
 
+#ifdef TARGET_NR_accept
+IMPL(accept)
+{
+    return do_accept4(arg1, arg2, arg3, 0);
+}
+#endif
+
+IMPL(accept4)
+{
+    return do_accept4(arg1, arg2, arg3, arg4);
+}
+
 #ifdef TARGET_NR_access
 IMPL(access)
 {
@@ -7769,6 +7781,13 @@  IMPL(alarm)
 }
 #endif
 
+#ifdef TARGET_NR_bind
+IMPL(bind)
+{
+    return do_bind(arg1, arg2, arg3);
+}
+#endif
+
 IMPL(brk)
 {
     return do_brk(arg1);
@@ -7821,6 +7840,13 @@  IMPL(close)
     return get_errno(close(arg1));
 }
 
+#ifdef TARGET_NR_connect
+IMPL(connect)
+{
+    return do_connect(arg1, arg2, arg3);
+}
+#endif
+
 #ifdef TARGET_NR_creat
 IMPL(creat)
 {
@@ -9925,22 +9951,6 @@  static abi_long do_syscall1(void *cpu_env, unsigned num, abi_long arg1,
     void *p;
 
     switch(num) {
-#ifdef TARGET_NR_accept
-    case TARGET_NR_accept:
-        return do_accept4(arg1, arg2, arg3, 0);
-#endif
-#ifdef TARGET_NR_accept4
-    case TARGET_NR_accept4:
-        return do_accept4(arg1, arg2, arg3, arg4);
-#endif
-#ifdef TARGET_NR_bind
-    case TARGET_NR_bind:
-        return do_bind(arg1, arg2, arg3);
-#endif
-#ifdef TARGET_NR_connect
-    case TARGET_NR_connect:
-        return do_connect(arg1, arg2, arg3);
-#endif
 #ifdef TARGET_NR_getpeername
     case TARGET_NR_getpeername:
         return do_getpeername(arg1, arg2, arg3);
@@ -12769,9 +12779,16 @@  static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_access
         SYSCALL(access);
 #endif
+#ifdef TARGET_NR_accept
+        SYSCALL(accept);
+#endif
+        SYSCALL(accept4);
         SYSCALL(acct);
 #ifdef TARGET_NR_alarm
         SYSCALL(alarm);
+#endif
+#ifdef TARGET_NR_bind
+        SYSCALL(bind);
 #endif
         SYSCALL(brk);
         SYSCALL(close);
@@ -12780,6 +12797,9 @@  static impl_fn *syscall_table(unsigned num)
 #ifdef TARGET_NR_chmod
         SYSCALL(chmod);
 #endif
+#ifdef TARGET_NR_connect
+        SYSCALL(connect);
+#endif
 #ifdef TARGET_NR_creat
         SYSCALL(creat);
 #endif