about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.com>2017-03-06 14:51:51 +0100
committerAdhemerval Zanella <adhemerval.zanella@linaro.com>2017-03-09 15:22:06 +0100
commit06cf371e978cde2df19efa1474791bd2532f529b (patch)
tree3636b934bd4ac0fe5ec47a2ef41b6e25eb1e4136
parentdf799d9eb335921f53aab8834219ef77fe280bc8 (diff)
downloadglibc-06cf371e978cde2df19efa1474791bd2532f529b.tar.gz
glibc-06cf371e978cde2df19efa1474791bd2532f529b.tar.xz
glibc-06cf371e978cde2df19efa1474791bd2532f529b.zip
Consolidate Linux sendto implementation
This patch consolidates the sendto Linux syscall implementation on
sysdeps/unix/sysv/linux/sendto.c.  The changes are:

   1. Define __ASSUME_SENDTO_SYSCALL by default.
   2. Undef it for architectures that do not support __NR_sendto.

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 sendto 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/mips/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/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Define by default.
	* sysdeps/unix/sysv/linux/i386/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Undef it is kernel does not support
	__NR_sendto.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/s390/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Remove definition.
	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
	(__ASSUME_SENDTO_SYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/sh/kernel-features.h:
	(__ASSUME_SENDTO_SYSCALL): Likewise.
	* sysdeps/unix/sysv/linux/sendto.c: Simplify includes.
-rw-r--r--ChangeLog26
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/arm/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/generic/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/i386/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/ia64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel-features.h2
-rw-r--r--sysdeps/unix/sysv/linux/sendto.c5
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/syscalls.list1
17 files changed, 30 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 05f09be279..581ad979de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,31 @@
 2016-03-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove sendto 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/mips/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/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Define by default.
+	* sysdeps/unix/sysv/linux/i386/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Undef it is kernel does not support
+	__NR_sendto.
+	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Likewise.
+	* sysdeps/unix/sysv/linux/s390/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Likewise.
+	* sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Remove definition.
+	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+	(__ASSUME_SENDTO_SYSCALL): Likewise.
+	* sysdeps/unix/sysv/linux/sh/kernel-features.h:
+	(__ASSUME_SENDTO_SYSCALL): Likewise.
+	* sysdeps/unix/sysv/linux/sendto.c: Simplify includes.
+
 	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove recv from
 	auto-generation list.
 	* sysdeps/unix/sysv/linux/arm/syscalls.list: Likewise.
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 8a62b6e8b1..304e97ef6f 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -11,7 +11,6 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 send		-	send		Ci:ibni	__libc_send	__send send
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list
index 9f445e6aac..4ca4f81f1a 100644
--- a/sysdeps/unix/sysv/linux/arm/syscalls.list
+++ b/sysdeps/unix/sysv/linux/arm/syscalls.list
@@ -28,7 +28,6 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 send		-	send		Ci:ibni	__libc_send	__send send
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index c16ee52dfd..ed8b216d47 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -7,7 +7,6 @@ bind		-	bind		i:ipi	__bind		bind
 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
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list
index 1248877bc8..eaa20b35bb 100644
--- a/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -7,7 +7,6 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 send		-	send		Ci:ibni	__libc_send	__send send
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index a886442702..63920340f0 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -36,7 +36,6 @@
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
-# define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -51,6 +50,7 @@
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall.  */
diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list
index 24e9c98e5c..64d47f4d49 100644
--- a/sysdeps/unix/sysv/linux/ia64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list
@@ -11,7 +11,6 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 send		-	send		Ci:ibni	__libc_send	__send send
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index c6c816eb29..318fcf935a 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -150,6 +150,7 @@
 #define __ASSUME_ACCEPT_SYSCALL		1
 #define __ASSUME_CONNECT_SYSCALL	1
 #define __ASSUME_RECVFROM_SYSCALL	1
+#define __ASSUME_SENDTO_SYSCALL		1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index f2b4958991..0f590fd768 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -30,7 +30,6 @@
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
-# define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -47,6 +46,7 @@
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index e4bf4d52c8..fe170a0987 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -28,7 +28,6 @@
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
-#define __ASSUME_SENDTO_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 #define __ASSUME_SHUTDOWN_SYSCALL	1
 #define __ASSUME_GETSOCKOPT_SYSCALL	1
diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list
index 48a33bba79..0f0ecc1ef5 100644
--- a/sysdeps/unix/sysv/linux/mips/syscalls.list
+++ b/sysdeps/unix/sysv/linux/mips/syscalls.list
@@ -18,7 +18,6 @@ getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getsockopt	-	getsockopt	i:iiiBN	__getsockopt	getsockopt
 listen		-	listen		i:ii	__listen	listen
 send		-	send		Ci:ibni	__libc_send	__send send
-sendto		-	sendto		Ci:ibnibn __libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index a0d2e8fece..dc9ad941f7 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -29,7 +29,6 @@
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
-#define __ASSUME_SENDTO_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 #define __ASSUME_SHUTDOWN_SYSCALL	1
 #define __ASSUME_GETSOCKOPT_SYSCALL	1
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index 59bc434a8a..e79191ac84 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -30,7 +30,6 @@
 # define __ASSUME_SETSOCKOPT_SYSCALL         1
 # define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
-# define __ASSUME_SENDTO_SYSCALL             1
 # define __ASSUME_SENDTO_FOR_SEND_SYSCALL    1
 # define __ASSUME_SHUTDOWN_SYSCALL           1
 #endif
@@ -47,6 +46,7 @@
 # undef __ASSUME_RECVMSG_SYSCALL
 # undef __ASSUME_CONNECT_SYSCALL
 # undef __ASSUME_RECVFROM_SYSCALL
+# undef __ASSUME_SENDTO_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall.  */
diff --git a/sysdeps/unix/sysv/linux/sendto.c b/sysdeps/unix/sysv/linux/sendto.c
index 2b9e1d7269..be1bc6fd99 100644
--- a/sysdeps/unix/sysv/linux/sendto.c
+++ b/sysdeps/unix/sysv/linux/sendto.c
@@ -15,14 +15,9 @@
    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_sendto (int fd, const void *buf, size_t len, int flags,
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index 5ed5f93a66..b0b321576c 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -32,7 +32,6 @@
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
-#define __ASSUME_SENDTO_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 #define __ASSUME_SHUTDOWN_SYSCALL	1
 #define __ASSUME_GETSOCKOPT_SYSCALL	1
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
index bf2cfdc260..4cfc2afcda 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
@@ -8,7 +8,6 @@ getsockname	-	getsockname	3	__getsockname	getsockname
 getsockopt	-	getsockopt	5	__getsockopt	getsockopt
 listen		-	listen		2	__listen	listen
 send		-	send		C:4	__libc_send	__send send
-sendto		-	sendto		C:6	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	5	__setsockopt	setsockopt
 shutdown	-	shutdown	2	__shutdown	shutdown
 socketpair	-	socketpair	4	__socketpair	socketpair
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 7ff03761e2..889193ba76 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -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
-sendto		-	sendto		Ci:ibnibn	__libc_sendto	__sendto sendto
 setsockopt	-	setsockopt	i:iiibn	__setsockopt	setsockopt
 shutdown	-	shutdown	i:ii	__shutdown	shutdown
 socket		-	socket		i:iii	__socket	socket