]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Consolidate Linux recvfrom implementation
authorAdhemerval Zanella <adhemerval.zanella@linaro.com>
Mon, 6 Mar 2017 11:53:14 +0000 (12:53 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>
Thu, 9 Mar 2017 14:22:06 +0000 (15:22 +0100)
This patch consolidates the recvfrom Linux syscall implementation on
sysdeps/unix/sysv/linux/recvfrom.c.  The changes are:

  1. Define __ASSUME_RECVFROM_SYSCALL by default
  2. Undef it for  architectures that do not support __NR_recvfrom.

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 recvfrom from
auto-generation list.
* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/generic/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/ia64/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/mips/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/i386/kernel-features.h
* sysdeps/unix/sysv/linux/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Define by default.
(__ASSUME_RECVFROM_SYSCALL): Undef it if kernel does not support
__NR_recvfrom.
* sysdeps/unix/sysv/linux/m68k/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/s390/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Remove definition.
* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/sparc/kernel-features.h
(__ASSUME_RECVFROM_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/recvfrom.c: Simplify includes.

18 files changed:
ChangeLog
sysdeps/unix/sysv/linux/alpha/syscalls.list
sysdeps/unix/sysv/linux/arm/syscalls.list
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/microblaze/kernel-features.h
sysdeps/unix/sysv/linux/mips/syscalls.list
sysdeps/unix/sysv/linux/powerpc/kernel-features.h
sysdeps/unix/sysv/linux/recvfrom.c
sysdeps/unix/sysv/linux/s390/kernel-features.h
sysdeps/unix/sysv/linux/sh/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 95b0856ad4a0fe0c6ffdc277e1a9aeb82d238e02..9b8d4053d476bac84499286a4f77ddf04c739778 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,33 @@
 2016-03-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove recvfrom from
+       auto-generation list.
+       * sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/generic/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/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/mips/syscalls.list: Likewise.
+       * sysdeps/unix/sysv/linux/i386/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Define by default.
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Undef it if kernel does not support
+       __NR_recvfrom.
+       * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/s390/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Remove definition.
+       * sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/sh/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/kernel-features.h
+       (__ASSUME_RECVFROM_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/recvfrom.c: Simplify includes.
+
        * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove connect from
        auto-generation list.
        * sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
index e9efb43b566494e7cd81f348e108ea20f793ecca..9cb44c13838bd7861715eabd119843eea68b5546 100644 (file)
@@ -11,7 +11,6 @@ getsockname   -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
 recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 send           -       send            Ci:ibni __libc_send     __send send
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
index 1c12be4eef4c4ad59ddef26f16aade0e7561fb3b..dc4f52a66ba37fe59733a39f55397700623ed28e 100644 (file)
@@ -28,7 +28,6 @@ getsockname   -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
 recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 send           -       send            Ci:ibni __libc_send     __send send
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
index 2874a1f8c7b30c672d8c29c724b6f1b6f7d00174..c16ee52dfd3704d267077d8d68d6aebb92022b37 100644 (file)
@@ -8,7 +8,6 @@ listen          -       listen          i:ii    __listen        listen
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getpeername    -       getpeername     i:ipp   __getpeername   getpeername
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 shutdown       -       shutdown        i:ii    __shutdown      shutdown
index 288d096820b95032d31b8cb0eb9cd264a67f2c96..88341157d15f3004376f67a4cf13e08b05024f06 100644 (file)
@@ -7,7 +7,6 @@ getsockname     -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
 recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 send           -       send            Ci:ibni __libc_send     __send send
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
index 23ca79437f0053b5b658170a77abc4cc9c7b703e..4ccab5d74eced082024d1567caac30657d8651c4 100644 (file)
@@ -38,7 +38,6 @@
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
-# define __ASSUME_RECVFROM_SYSCALL           1
 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL  1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -52,6 +51,7 @@
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall.  */
index 32fdb0878b4f3844e148fb9092e0ad2f51af3aa7..57020a9f5ad76d44186fcc0a029edc5e803a711d 100644 (file)
@@ -11,7 +11,6 @@ getsockname   -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
 recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 send           -       send            Ci:ibni __libc_send     __send send
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
index e93f5f441fc7c6bbe89d68fd0a3de0a8d5c758a8..c6c816eb2958f25b1cdb521addad0826cb53ae4c 100644 (file)
 #define __ASSUME_RECVMSG_SYSCALL       1
 #define __ASSUME_ACCEPT_SYSCALL                1
 #define __ASSUME_CONNECT_SYSCALL       1
+#define __ASSUME_RECVFROM_SYSCALL      1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
index e19ccf72b881a966a3b4571eb1374f0054c8ecb4..fa874b37b8c78445155c066eee56a66758d7739a 100644 (file)
@@ -32,7 +32,6 @@
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
-# define __ASSUME_RECVFROM_SYSCALL           1
 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL  1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -48,6 +47,7 @@
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
index 9532d5716ecca8fea5b87b29aa093a321409d730..e4bf4d52c8c7fa1ae3b4ffb1eecc135781d833d0 100644 (file)
@@ -30,7 +30,6 @@
 #define __ASSUME_SEND_SYSCALL          1
 #define __ASSUME_SENDTO_SYSCALL                1
 #define __ASSUME_RECV_SYSCALL          1
-#define __ASSUME_RECVFROM_SYSCALL      1
 #define __ASSUME_SHUTDOWN_SYSCALL      1
 #define __ASSUME_GETSOCKOPT_SYSCALL    1
 #define __ASSUME_SETSOCKOPT_SYSCALL    1
index 8b0c5a3ad6f4a5a0510cb0656fa6fbfa90e8acfb..053574edc5763f2f9442180c761e1db1f13ae313 100644 (file)
@@ -18,7 +18,6 @@ getsockname   -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
 recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN __libc_recvfrom __recvfrom recvfrom
 send           -       send            Ci:ibni __libc_send     __send send
 sendto         -       sendto          Ci:ibnibn __libc_sendto __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
index 272800c263d31cd2f73ec25cf3056673952d2c9c..a0d2e8fece9a54f6bf5df1c478041d31e48f4265 100644 (file)
@@ -31,7 +31,6 @@
 #define __ASSUME_SEND_SYSCALL          1
 #define __ASSUME_SENDTO_SYSCALL                1
 #define __ASSUME_RECV_SYSCALL          1
-#define __ASSUME_RECVFROM_SYSCALL      1
 #define __ASSUME_SHUTDOWN_SYSCALL      1
 #define __ASSUME_GETSOCKOPT_SYSCALL    1
 #define __ASSUME_SETSOCKOPT_SYSCALL    1
index 10ffb261eaed8993ec63a56f57e3667130138a9f..27c2360f64e44d0e730b354dc3e1b7d80ac75d21 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>
 
 ssize_t
 __libc_recvfrom (int fd, void *buf, size_t len, int flags,
index 50a7e8cc2a11c03b0c8b0b924082c19cb35852d9..29738afcb62447a4c8ed2f2ffa9182fc4a4b8f5d 100644 (file)
@@ -32,7 +32,6 @@
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 # define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
-# define __ASSUME_RECVFROM_SYSCALL           1
 # define __ASSUME_RECVFROM_FOR_RECV_SYSCALL  1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -48,6 +47,7 @@
 # undef __ASSUME_SENDMSG_SYSCALL
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall.  */
index 7a83211661dde4444b48b8c95868a372d5637d88..5ed5f93a664ed1d95e8396ce916bcfa956060b04 100644 (file)
@@ -34,7 +34,6 @@
 #define __ASSUME_SEND_SYSCALL          1
 #define __ASSUME_SENDTO_SYSCALL                1
 #define __ASSUME_RECV_SYSCALL          1
-#define __ASSUME_RECVFROM_SYSCALL      1
 #define __ASSUME_SHUTDOWN_SYSCALL      1
 #define __ASSUME_GETSOCKOPT_SYSCALL    1
 #define __ASSUME_SETSOCKOPT_SYSCALL    1
index ba6e4c44e7aacb9410d20deec6fe2d9005c94119..8e74478e27d9d1d6ed49150af2dde6784092201b 100644 (file)
@@ -41,6 +41,7 @@
 #if !defined __arch64__
 # undef __ASSUME_ACCEPT_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
+# undef __ASSUME_RECVFROM_SYSCALL
 #endif
 
 /* sparc only supports ipc syscall.  */
index 4c785fd019430c5b6005e84910d5f61fb7acfa6e..f73b5195f492dd452351ee8c46c54d52e72e0bb5 100644 (file)
@@ -8,7 +8,6 @@ getsockname     -       getsockname     3       __getsockname   getsockname
 getsockopt     -       getsockopt      5       __getsockopt    getsockopt
 listen         -       listen          2       __listen        listen
 recv           -       recv            C:4     __libc_recv     __recv recv
-recvfrom       -       recvfrom        C:6     __libc_recvfrom __recvfrom recvfrom
 send           -       send            C:4     __libc_send     __send send
 sendto         -       sendto          C:6     __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      5       __setsockopt    setsockopt
index b8325938231d625db75474eb0aea9901610069bf..7ff03761e2232f3f8952124f2ee67ae2e8cdcde2 100644 (file)
@@ -15,7 +15,6 @@ getpeername   -       getpeername     i:ipp   __getpeername   getpeername
 getsockname    -       getsockname     i:ipp   __getsockname   getsockname
 getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
 listen         -       listen          i:ii    __listen        listen
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom __recvfrom recvfrom
 sendto         -       sendto          Ci:ibnibn       __libc_sendto   __sendto sendto
 setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
 shutdown       -       shutdown        i:ii    __shutdown      shutdown