]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Consolidate Linux connect implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 17 Nov 2016 20:15:52 +0000 (18:15 -0200)
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>
Thu, 9 Mar 2017 14:22:06 +0000 (15:22 +0100)
This patch consolidates the connect Linux syscall implementation on
sysdeps/unix/sysv/linux/accept.c.  The changes are:

  1. Remove connect from auto-generation syscalls.list on the architecture
     that uses __NR_connect.
  2. Define __NR_connect as default (__ASSUME_CONNECT_SYSCALL) and undef for
     architectures that do not support it.

Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32,
aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu.

* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove connect from
auto-generation list.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/generic/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/connect.c: Simplify include list.
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_CONNECT_SYSCALL): Define.
* sysdeps/unix/sysv/linux/i386/kernel-features.h
(__ASSUME_CONNECT_SYSCALL): Undef if kernel does not support it.
* sysdeps/unix/sysv/linux/m68k/kernel-features.h
(__ASSUME_CONNECT_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/s390/kernel-features.h
(__ASSUME_CONNECT_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/sparc/kernel-features.h
(__ASSUME_CONNECT_SYSCALL): Likewise.

15 files changed:
ChangeLog
sysdeps/unix/sysv/linux/alpha/syscalls.list
sysdeps/unix/sysv/linux/arm/syscalls.list
sysdeps/unix/sysv/linux/connect.c
sysdeps/unix/sysv/linux/generic/syscalls.list
sysdeps/unix/sysv/linux/hppa/syscalls.list
sysdeps/unix/sysv/linux/i386/kernel-features.h
sysdeps/unix/sysv/linux/ia64/syscalls.list
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/m68k/kernel-features.h
sysdeps/unix/sysv/linux/mips/syscalls.list
sysdeps/unix/sysv/linux/s390/kernel-features.h
sysdeps/unix/sysv/linux/sparc/kernel-features.h
sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
sysdeps/unix/sysv/linux/x86_64/syscalls.list

index 1c8c729a527ed426d6dac326d01c38f9727bdfd7..95b0856ad4a0fe0c6ffdc277e1a9aeb82d238e02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
 2016-03-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove connect from
+       auto-generation list.
+       * sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/generic/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/connect.c: Simplify include list.
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_CONNECT_SYSCALL): Define.
+       * sysdeps/unix/sysv/linux/i386/kernel-features.h
+       (__ASSUME_CONNECT_SYSCALL): Undef if kernel does not support it.
+       * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+       (__ASSUME_CONNECT_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/s390/kernel-features.h
+       (__ASSUME_CONNECT_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/kernel-features.h
+       (__ASSUME_CONNECT_SYSCALL): Likewise.
+
        * sysdeps/unix/sysv/linux/accept.c (__libc_accept): Replace
        __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL by __ASSUME_ACCEPT4_SYSCALL.
        * sysdeps/unix/sysv/linux/alpha/syscalls.list?: Remove accept from
index 4cfe19e645fa991f4c01aac8f095f21df076b4db..e9efb43b566494e7cd81f348e108ea20f793ecca 100644 (file)
@@ -6,7 +6,6 @@ getpriority     -       getpriority     i:ii    __getpriority   getpriority
 
 # proper socket implementations:
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
index 1c4f61ff40b328a0571c4d5db65c49b7780755f6..1c12be4eef4c4ad59ddef26f16aade0e7561fb3b 100644 (file)
@@ -23,7 +23,6 @@ personality   EXTRA   personality     Ei:i    __personality   personality
 
 # proper socket implementations:
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
index 3837a5bea0c737fec91418c67ae6c37111761094..f6ab5df6ad7bd2597b92a9c01b656ad8ba5daca3 100644 (file)
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <signal.h>
 #include <sys/socket.h>
-
 #include <sysdep-cancel.h>
 #include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
 
 int
 __libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
index b176a729d7fedd4fc059da7156ae91c20c39b86a..2874a1f8c7b30c672d8c29c724b6f1b6f7d00174 100644 (file)
@@ -5,7 +5,6 @@ socket          -       socket          i:iii   __socket        socket
 socketpair     -       socketpair      i:iiif  __socketpair    socketpair
 bind           -       bind            i:ipi   __bind          bind
 listen         -       listen          i:ii    __listen        listen
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
index ee814fba6f6a6e83e1ccb1b5c94c61b86cde229a..288d096820b95032d31b8cb0eb9cd264a67f2c96 100644 (file)
@@ -2,7 +2,6 @@
 
 # proper socket implementations:
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
index 07462f824a8f113444c81a98645f25537ef797f7..23ca79437f0053b5b658170a77abc4cc9c7b703e 100644 (file)
@@ -31,7 +31,6 @@
 # define __ASSUME_SOCKET_SYSCALL             1
 # define __ASSUME_SOCKETPAIR_SYSCALL         1
 # define __ASSUME_BIND_SYSCALL               1
-# define __ASSUME_CONNECT_SYSCALL            1
 # define __ASSUME_LISTEN_SYSCALL             1
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
@@ -52,6 +51,7 @@
 # undef __ASSUME_ACCEPT4_SYSCALL
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall.  */
index 96db4c30a5111a8644bc2476e1ef840379d10b55..32fdb0878b4f3844e148fb9092e0ad2f51af3aa7 100644 (file)
@@ -6,7 +6,6 @@ getpriority     -       getpriority     i:ii    __getpriority   getpriority
 
 # proper socket implementations:
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
index 78b091b6ae65cf3d943486fa79f80b2a9e6b22d1..e93f5f441fc7c6bbe89d68fd0a3de0a8d5c758a8 100644 (file)
 #define __ASSUME_SENDMSG_SYSCALL       1
 #define __ASSUME_RECVMSG_SYSCALL       1
 #define __ASSUME_ACCEPT_SYSCALL                1
+#define __ASSUME_CONNECT_SYSCALL       1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
index ff196ac12f617291c6bda92f106fd31aecc8713d..e19ccf72b881a966a3b4571eb1374f0054c8ecb4 100644 (file)
@@ -25,7 +25,6 @@
 # define __ASSUME_SOCKET_SYSCALL             1
 # define __ASSUME_SOCKETPAIR_SYSCALL         1
 # define __ASSUME_BIND_SYSCALL               1
-# define __ASSUME_CONNECT_SYSCALL            1
 # define __ASSUME_LISTEN_SYSCALL             1
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
@@ -48,6 +47,7 @@
 # undef __ASSUME_SENDMMSG_SYSCALL
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
index 81ea2a7ada39c7fc54fce2d07090db0c7bcf187d..8b0c5a3ad6f4a5a0510cb0656fa6fbfa90e8acfb 100644 (file)
@@ -13,7 +13,6 @@ sysmips               -       sysmips         i:iiii  __sysmips       sysmips
 # it's provided for compatibility, though.
 #
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
index ccfb0a2c88a06ad142c866cfddf9c07840ec43f5..50a7e8cc2a11c03b0c8b0b924082c19cb35852d9 100644 (file)
@@ -25,7 +25,6 @@
 # define __ASSUME_SOCKET_SYSCALL             1
 # define __ASSUME_SOCKETPAIR_SYSCALL         1
 # define __ASSUME_BIND_SYSCALL               1
-# define __ASSUME_CONNECT_SYSCALL            1
 # define __ASSUME_LISTEN_SYSCALL             1
 # define __ASSUME_GETSOCKOPT_SYSCALL         1
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
@@ -48,6 +47,7 @@
 # undef __ASSUME_SENDMMSG_SYSCALL
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall.  */
index 3ffa96e303259279f86022b754979334ff1d4c6c..ba6e4c44e7aacb9410d20deec6fe2d9005c94119 100644 (file)
@@ -40,6 +40,7 @@
 
 #if !defined __arch64__
 # undef __ASSUME_ACCEPT_SYSCALL
+# undef __ASSUME_CONNECT_SYSCALL
 #endif
 
 /* sparc only supports ipc syscall.  */
index 27ca5fa4a303460196a812e4867fa8d7115fd610..4c785fd019430c5b6005e84910d5f61fb7acfa6e 100644 (file)
@@ -3,7 +3,6 @@
 # Override select.S in parent directory:
 select         -       select          C:5     __select        select
 bind           -       bind            3       __bind          bind
-connect                -       connect         C:3     __libc_connect  __connect connect
 getpeername    -       getpeername     3       __getpeername   getpeername
 getsockname    -       getsockname     3       __getsockname   getsockname
 getsockopt     -       getsockopt      5       __getsockopt    getsockopt
index fe7d1567cb6db4a9ec36746ef3a90b768fbde285..b8325938231d625db75474eb0aea9901610069bf 100644 (file)
@@ -11,7 +11,6 @@ syscall_clock_gettime EXTRA   clock_gettime   Ei:ip           __syscall_clock_gettime
 
 # proper socket implementations:
 bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  __connect connect
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt