mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-18 06:30:05 +00:00
Consolidate Linux connect implementation
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.
This commit is contained in:
parent
01061a7cab
commit
3e9ff426cb
21
ChangeLog
21
ChangeLog
@ -1,5 +1,26 @@
|
|||||||
2016-03-08 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
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
|
* sysdeps/unix/sysv/linux/accept.c (__libc_accept): Replace
|
||||||
__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL by __ASSUME_ACCEPT4_SYSCALL.
|
__ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL by __ASSUME_ACCEPT4_SYSCALL.
|
||||||
* sysdeps/unix/sysv/linux/alpha/syscalls.list?: Remove accept from
|
* sysdeps/unix/sysv/linux/alpha/syscalls.list?: Remove accept from
|
||||||
|
@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority
|
|||||||
|
|
||||||
# proper socket implementations:
|
# proper socket implementations:
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
@ -23,7 +23,6 @@ personality EXTRA personality Ei:i __personality personality
|
|||||||
|
|
||||||
# proper socket implementations:
|
# proper socket implementations:
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
@ -15,14 +15,9 @@
|
|||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <sysdep-cancel.h>
|
#include <sysdep-cancel.h>
|
||||||
#include <socketcall.h>
|
#include <socketcall.h>
|
||||||
#include <kernel-features.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
int
|
int
|
||||||
__libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
|
__libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
|
||||||
|
@ -5,7 +5,6 @@ socket - socket i:iii __socket socket
|
|||||||
socketpair - socketpair i:iiif __socketpair socketpair
|
socketpair - socketpair i:iiif __socketpair socketpair
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
listen - listen i:ii __listen listen
|
listen - listen i:ii __listen listen
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
|
sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
# proper socket implementations:
|
# proper socket implementations:
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
# define __ASSUME_SOCKET_SYSCALL 1
|
# define __ASSUME_SOCKET_SYSCALL 1
|
||||||
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
||||||
# define __ASSUME_BIND_SYSCALL 1
|
# define __ASSUME_BIND_SYSCALL 1
|
||||||
# define __ASSUME_CONNECT_SYSCALL 1
|
|
||||||
# define __ASSUME_LISTEN_SYSCALL 1
|
# define __ASSUME_LISTEN_SYSCALL 1
|
||||||
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
||||||
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
||||||
@ -52,6 +51,7 @@
|
|||||||
# undef __ASSUME_ACCEPT4_SYSCALL
|
# undef __ASSUME_ACCEPT4_SYSCALL
|
||||||
# undef __ASSUME_SENDMSG_SYSCALL
|
# undef __ASSUME_SENDMSG_SYSCALL
|
||||||
# undef __ASSUME_RECVMSG_SYSCALL
|
# undef __ASSUME_RECVMSG_SYSCALL
|
||||||
|
# undef __ASSUME_CONNECT_SYSCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* i686 only supports ipc syscall. */
|
/* i686 only supports ipc syscall. */
|
||||||
|
@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority
|
|||||||
|
|
||||||
# proper socket implementations:
|
# proper socket implementations:
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
@ -148,6 +148,7 @@
|
|||||||
#define __ASSUME_SENDMSG_SYSCALL 1
|
#define __ASSUME_SENDMSG_SYSCALL 1
|
||||||
#define __ASSUME_RECVMSG_SYSCALL 1
|
#define __ASSUME_RECVMSG_SYSCALL 1
|
||||||
#define __ASSUME_ACCEPT_SYSCALL 1
|
#define __ASSUME_ACCEPT_SYSCALL 1
|
||||||
|
#define __ASSUME_CONNECT_SYSCALL 1
|
||||||
|
|
||||||
/* Support for SysV IPC through wired syscalls. All supported architectures
|
/* Support for SysV IPC through wired syscalls. All supported architectures
|
||||||
either support ipc syscall and/or all the ipc correspondent syscalls. */
|
either support ipc syscall and/or all the ipc correspondent syscalls. */
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
# define __ASSUME_SOCKET_SYSCALL 1
|
# define __ASSUME_SOCKET_SYSCALL 1
|
||||||
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
||||||
# define __ASSUME_BIND_SYSCALL 1
|
# define __ASSUME_BIND_SYSCALL 1
|
||||||
# define __ASSUME_CONNECT_SYSCALL 1
|
|
||||||
# define __ASSUME_LISTEN_SYSCALL 1
|
# define __ASSUME_LISTEN_SYSCALL 1
|
||||||
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
||||||
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
||||||
@ -48,6 +47,7 @@
|
|||||||
# undef __ASSUME_SENDMMSG_SYSCALL
|
# undef __ASSUME_SENDMMSG_SYSCALL
|
||||||
# undef __ASSUME_SENDMSG_SYSCALL
|
# undef __ASSUME_SENDMSG_SYSCALL
|
||||||
# undef __ASSUME_RECVMSG_SYSCALL
|
# undef __ASSUME_RECVMSG_SYSCALL
|
||||||
|
# undef __ASSUME_CONNECT_SYSCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
|
/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
|
||||||
|
@ -13,7 +13,6 @@ sysmips - sysmips i:iiii __sysmips sysmips
|
|||||||
# it's provided for compatibility, though.
|
# it's provided for compatibility, though.
|
||||||
#
|
#
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
# define __ASSUME_SOCKET_SYSCALL 1
|
# define __ASSUME_SOCKET_SYSCALL 1
|
||||||
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
# define __ASSUME_SOCKETPAIR_SYSCALL 1
|
||||||
# define __ASSUME_BIND_SYSCALL 1
|
# define __ASSUME_BIND_SYSCALL 1
|
||||||
# define __ASSUME_CONNECT_SYSCALL 1
|
|
||||||
# define __ASSUME_LISTEN_SYSCALL 1
|
# define __ASSUME_LISTEN_SYSCALL 1
|
||||||
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
# define __ASSUME_GETSOCKOPT_SYSCALL 1
|
||||||
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
# define __ASSUME_SETSOCKOPT_SYSCALL 1
|
||||||
@ -48,6 +47,7 @@
|
|||||||
# undef __ASSUME_SENDMMSG_SYSCALL
|
# undef __ASSUME_SENDMMSG_SYSCALL
|
||||||
# undef __ASSUME_SENDMSG_SYSCALL
|
# undef __ASSUME_SENDMSG_SYSCALL
|
||||||
# undef __ASSUME_RECVMSG_SYSCALL
|
# undef __ASSUME_RECVMSG_SYSCALL
|
||||||
|
# undef __ASSUME_CONNECT_SYSCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* s390 only supports ipc syscall. */
|
/* s390 only supports ipc syscall. */
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#if !defined __arch64__
|
#if !defined __arch64__
|
||||||
# undef __ASSUME_ACCEPT_SYSCALL
|
# undef __ASSUME_ACCEPT_SYSCALL
|
||||||
|
# undef __ASSUME_CONNECT_SYSCALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* sparc only supports ipc syscall. */
|
/* sparc only supports ipc syscall. */
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
# Override select.S in parent directory:
|
# Override select.S in parent directory:
|
||||||
select - select C:5 __select select
|
select - select C:5 __select select
|
||||||
bind - bind 3 __bind bind
|
bind - bind 3 __bind bind
|
||||||
connect - connect C:3 __libc_connect __connect connect
|
|
||||||
getpeername - getpeername 3 __getpeername getpeername
|
getpeername - getpeername 3 __getpeername getpeername
|
||||||
getsockname - getsockname 3 __getsockname getsockname
|
getsockname - getsockname 3 __getsockname getsockname
|
||||||
getsockopt - getsockopt 5 __getsockopt getsockopt
|
getsockopt - getsockopt 5 __getsockopt getsockopt
|
||||||
|
@ -11,7 +11,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
|
|||||||
|
|
||||||
# proper socket implementations:
|
# proper socket implementations:
|
||||||
bind - bind i:ipi __bind bind
|
bind - bind i:ipi __bind bind
|
||||||
connect - connect Ci:ipi __libc_connect __connect connect
|
|
||||||
getpeername - getpeername i:ipp __getpeername getpeername
|
getpeername - getpeername i:ipp __getpeername getpeername
|
||||||
getsockname - getsockname i:ipp __getsockname getsockname
|
getsockname - getsockname i:ipp __getsockname getsockname
|
||||||
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
getsockopt - getsockopt i:iiiBN __getsockopt getsockopt
|
||||||
|
Loading…
Reference in New Issue
Block a user