@@ -36,6 +36,27 @@
#endif
#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
+/* New syscalls added for PowerPC in 2.6.37. */
+#if __LINUX_KERNEL_VERSION >= 0x020625
+# define __ASSUME_SOCKET_SYSCALL 1
+# define __ASSUME_BIND_SYSCALL 1
+# define __ASSUME_CONNECT_SYSCALL 1
+# define __ASSUME_LISTEN_SYSCALL 1
+# define __ASSUME_ACCEPT_SYSCALL 1
+# define __ASSUME_GETSOCKNAME_SYSCALL 1
+# 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_RECVFROM_SYSCALL 1
+# define __ASSUME_SHUTDOWN_SYSCALL 1
+# define __ASSUME_GETSOCKOPT_SYSCALL 1
+# define __ASSUME_SETSOCKOPT_SYSCALL 1
+# define __ASSUME_SENDMSG_SYSCALL 1
+# define __ASSUME_RECVMSG_SYSCALL 1
+#endif
+
#include_next <kernel-features.h>
/* PowerPC64 IPC is always 64-bit and does not use __IPC_64. */
new file mode 100644
@@ -0,0 +1,34 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_ACCEPT_SYSCALL && defined __NR_accept
+int
+__libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *len)
+{
+ return SYSCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
+}
+weak_alias (__libc_accept, accept)
+libc_hidden_def (accept)
+#else
+#include <sysdeps/unix/sysv/linux/accept.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_BIND_SYSCALL && defined __NR_bind
+int
+__bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
+{
+ return INLINE_SYSCALL (bind, 3, fd, addr.__sockaddr__, len);
+}
+weak_alias (__bind, bind)
+#else
+#include <sysdeps/unix/sysv/linux/bind.c>
+#endif
new file mode 100644
@@ -0,0 +1,35 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_CONNECT_SYSCALL && defined __NR_connect
+int
+__libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
+{
+ return SYSCALL_CANCEL (connect, fd, addr.__sockaddr__, len);
+}
+weak_alias (__libc_connect, connect)
+weak_alias (__libc_connect, __connect)
+libc_hidden_weak (__connect)
+#else
+#include <sysdeps/unix/sysv/linux/connect.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_GETPEERNAME_SYSCALL && defined __NR_getpeername
+int
+__getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len)
+{
+ return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len);
+}
+weak_alias (__getpeername, getpeername)
+#else
+#include <sysdeps/unix/sysv/linux/getpeername.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_GETSOCKNAME_SYSCALL && defined __NR_getsockname
+int
+__getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
+{
+ return INLINE_SYSCALL (getsockname, 3, fd, addr.__sockaddr__, len);
+}
+weak_alias (__getsockname, getsockname)
+#else
+#include <sysdeps/unix/sysv/linux/getsockname.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_GETSOCKOPT_SYSCALL && defined __NR_getsockopt
+int
+__getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
+{
+ return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len);
+}
+weak_alias (__getsockopt, getsockopt)
+#else
+#include <sysdeps/unix/sysv/linux/getsockopt.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_LISTEN_SYSCALL && defined __NR_listen
+int
+listen (int fd, int backlog)
+{
+ return INLINE_SYSCALL (listen, 2, fd, backlog);
+}
+weak_alias (listen, __listen)
+#else
+#include <sysdeps/unix/sysv/linux/listen.c>
+#endif
new file mode 100644
@@ -0,0 +1,34 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_RECV_SYSCALL && defined __NR_recv
+ssize_t
+__libc_recv (int fd, void *buf, size_t len, int flags)
+{
+ return SYSCALL_CANCEL (recv, fd, buf, len, flags);
+}
+weak_alias (__libc_recv, recv)
+weak_alias (__libc_recv, __recv)
+#else
+#include <sysdeps/unix/sysv/linux/recv.c>
+#endif
new file mode 100644
@@ -0,0 +1,36 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_RECVFROM_SYSCALL && defined __NR_recvfrom
+ssize_t
+__libc_recvfrom (int fd, void *buf, size_t len, int flags,
+ __SOCKADDR_ARG addr, socklen_t *addrlen)
+{
+ return SYSCALL_CANCEL (recvfrom, fd, buf, len, flags, addr.__sockaddr__,
+ addrlen);
+}
+weak_alias (__libc_recvfrom, recvfrom)
+weak_alias (__libc_recvfrom, __recvfrom)
+#else
+#include <sysdeps/unix/sysv/linux/recvfrom.c>
+#endif
new file mode 100644
@@ -0,0 +1,34 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_RECVMSG_SYSCALL && defined __NR_recvmsg
+ssize_t
+__libc_recvmsg (int fd, struct msghdr *msg, int flags)
+{
+ return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
+}
+weak_alias (__libc_recvmsg, recvmsg)
+weak_alias (__libc_recvmsg, __recvmsg)
+#else
+#include <sysdeps/unix/sysv/linux/recvmsg.c>
+#endif
new file mode 100644
@@ -0,0 +1,35 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_SEND_SYSCALL && defined __NR_send
+ssize_t
+__libc_send (int fd, const void *buf, size_t len, int flags)
+{
+ return SYSCALL_CANCEL (send, fd, buf, len, flags);
+}
+weak_alias (__libc_send, send)
+weak_alias (__libc_send, __send)
+libc_hidden_def (__send)
+#else
+#include <sysdeps/unix/sysv/linux/send.c>
+#endif
new file mode 100644
@@ -0,0 +1,34 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_SENDMSG_SYSCALL && defined __NR_sendmsg
+ssize_t
+__libc_sendmsg (int fd, const struct msghdr *msg, int flags)
+{
+ return SYSCALL_CANCEL (sendmsg, fd, msg, flags);
+}
+weak_alias (__libc_sendmsg, sendmsg)
+weak_alias (__libc_sendmsg, __sendmsg)
+#else
+#include <sysdeps/unix/sysv/linux/sendmsg.c>
+#endif
new file mode 100644
@@ -0,0 +1,36 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+#include <sysdep-cancel.h>
+
+#if defined __ASSUME_SENDTO_SYSCALL && defined __NR_sendto
+ssize_t
+__libc_sendto (int fd, const void *buf, size_t len, int flags,
+ __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
+{
+ return SYSCALL_CANCEL (sendto, fd, buf, len, flags, addr.__sockaddr__,
+ addrlen);
+}
+weak_alias (__libc_sendto, sendto)
+weak_alias (__libc_sendto, __sendto)
+#else
+#include <sysdeps/unix/sysv/linux/sendto.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_SETSOCKOPT_SYSCALL && defined __NR_setsockopt
+int
+setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
+{
+ return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len);
+}
+weak_alias (setsockopt, __setsockopt)
+#else
+#include <sysdeps/unix/sysv/linux/setsockopt.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_SHUTDOWN_SYSCALL && defined __NR_shutdown
+int
+__shutdown (int fd, int how)
+{
+ return INLINE_SYSCALL (shutdown, 2, fd, how);
+}
+weak_alias (__shutdown, shutdown)
+#else
+#include <sysdeps/unix/sysv/linux/shutdown.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_SOCKET_SYSCALL && defined __NR_socket
+int
+__socket (int fd, int type, int domain)
+{
+ return INLINE_SYSCALL (socket, 3, fd, type, domain);
+}
+weak_alias (__socket, socket)
+#else
+#include <sysdeps/unix/sysv/linux/socket.c>
+#endif
new file mode 100644
@@ -0,0 +1,32 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+#include <signal.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
+
+#if defined __ASSUME_SOCKETPAIR_SYSCALL && defined __NR_socketpair
+int
+__socketpair (int domain, int type, int protocol, int sv[2])
+{
+ return INLINE_SYSCALL (socketpair, 4, domain, type, protocol, sv);
+}
+weak_alias (__socketpair, socketpair)
+#else
+#include <sysdeps/unix/sysv/linux/socketpair.c>
+#endif