This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sendmmsg


Hi!

On Fri, 22 Jun 2012 15:06:53 +0200, I wrote:
> On 30 Mar 2012 11:43:09 -0000, drepper@sourceware.org wrote:
> > http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c030f70c8796c7743c3aa97d6beff3bd5b8dcd5d
> > 
> > commit c030f70c8796c7743c3aa97d6beff3bd5b8dcd5d
> > Author: Ulrich Drepper <drepper@gmail.com>
> > Date:   Fri Mar 30 07:42:29 2012 -0400
> > 
> >     Speed up DNS by avoiding a system call if possible
> 
> This patch adds a call to the (currently) Linux-specific sendmmsg to
> generic code:
> 
>     res_send.c: In function 'send_dg':
>     res_send.c:1113:22: error: array type has incomplete element type
>            struct mmsghdr reqs[2];
>                           ^
>     res_send.c:1132:7: warning: implicit declaration of function 'sendmmsg' [-Wimplicit-function-declaration]
>            int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
>            ^
> 
> > +	* resolv/res_send.c (send_dg): Use sendmmsg if we have to write two
> > +	requests to save a system call.
> 
> > +++ b/resolv/res_send.c
> > [...]
> > +		    int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
> 
> How do people want me to solve this?  a) Make the code use sendmmsg only
> if it is is available, or b) add a generic ENOSYS sendmmsg stub
> (appropriately versioned for 2.16/2.17) and move struct sendmmsg etc. to
> a generic place?  (The existing code already does and has to do the
> correct thing if sendmmsg "returns" ENOSYS (and probes only once), as
> this will also happen with older Linux kernels.)  I'd tend towards b)
> because we might add a sendmmsg implementation for GNU/Hurd later on.

This got a little bit more involved, I'm afraid.  If you feel more
comfortable that way, I'm fine with holding the patch back until after
the release, but would appreciate a quick review if the general approach
is fine.

Cross-build-tested for i686-gnu, Âmake checkÂ-tested for
x86_64-linux-gnu, where I also compared all *.o *.os to those without the
patch using GCC's contrib/compare-debug (no notable differences), and
also the resulting symbol version information looks as expected.

	* sysdeps/unix/sysv/linux/bits/socket.h (struct mmsghdr, recvmmsg)
	(sendmmsg): Move declarations...
	* socket/sys/socket.h: ... here.
	* socket/recvmmsg.c: New file.
	* socket/sendmmsg.c: New file.
	* sysdeps/unix/sysv/linux/internal_recvmmsg.S [__ASSUME_RECVMMSG]
	(recvmmsg): Rename to __recvmmsg, create weak alias and make definition
	of __recvmmsg hidden.
	* sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Likewise.  Include
	<socket/recvmmsg.c> for ENOSYS stub.
	* sysdeps/unix/sysv/linux/internal_sendmmsg.S [__ASSUME_SENDMMSG]
	(sendmmsg): Rename to __sendmmsg, create weak alias and make definition
	of __sendmmsg hidden.
	* sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise.  Include
	<socket/sendmmsg.c> for ENOSYS stub.
	* sysdeps/unix/sysv/linux/Makefile [subdir=socket] (sysdep_routines):
	Move recvmmsg and sendmmsg...
	* socket/Makefile (routines): ... here.
	* socket/Versions (GLIBC_2.16): Add __sendmmsg, recvmmsg, and sendmmsg.
	* include/sys/socket.h (__recvmmsg, __sendmmsg): Add declarations.
	* resolv/res_send.c (send_dg): Invoke __sendmmsg instead of sendmmsg.
	* sysdeps/unix/sysv/linux/i386/nptl/libc.abilist (GLIBC_2.16): Add
	__sendmmsg.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
	(GLIBC_2.16): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
	(GLIBC_2.16): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist (GLIBC_2.16):
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist (GLIBC_2.16):
	Likewise.
	* sysdeps/unix/sysv/linux/sh/nptl/libc.abilist (GLIBC_2.16): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist (GLIBC_2.16):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist (GLIBC_2.16):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist (GLIBC_2.16):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist (GLIBC_2.16):
	Likewise.

diff --git a/include/sys/socket.h b/include/sys/socket.h
index e356b75..8b09551 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -91,6 +91,10 @@ extern ssize_t __libc_sendmsg (int __fd, const struct msghdr *__message,
 extern ssize_t __sendmsg (int __fd, const struct msghdr *__message,
 			  int __flags) attribute_hidden;
 
+extern int __sendmmsg (int __fd, struct mmsghdr *__vmessages,
+                       unsigned int __vlen, int __flags);
+libc_hidden_proto (__sendmmsg)
+
 /* Receive a message as described by MESSAGE from socket FD.
    Returns the number of bytes read or -1 for errors.  */
 extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message,
@@ -98,6 +102,11 @@ extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message,
 extern ssize_t __recvmsg (int __fd, struct msghdr *__message,
 			  int __flags) attribute_hidden;
 
+extern int __recvmmsg (int __fd, struct mmsghdr *__vmessages,
+                       unsigned int __vlen, int __flags,
+                       const struct timespec *__tmo);
+libc_hidden_proto (__recvmmsg)
+
 /* Set socket FD's option OPTNAME at protocol level LEVEL
    to *OPTVAL (which is OPTLEN bytes long).
    Returns 0 on success, -1 for errors.  */
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 0a28cd7..c790031 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1129,7 +1129,7 @@ send_dg(res_state statp,
 		    reqs[1].msg_hdr.msg_control = NULL;
 		    reqs[1].msg_hdr.msg_controllen = 0;
 
-		    int ndg = sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
+		    int ndg = __sendmmsg (pfd[0].fd, reqs, 2, MSG_NOSIGNAL);
 		    if (__builtin_expect (ndg == 2, 1))
 		      {
 			if (reqs[0].msg_len != buflen
diff --git a/socket/Makefile b/socket/Makefile
index e3a90b8..6037f3f 100644
--- a/socket/Makefile
+++ b/socket/Makefile
@@ -26,7 +26,7 @@ headers	:= sys/socket.h sys/un.h bits/sockaddr.h bits/socket.h \
 routines := accept bind connect getpeername getsockname getsockopt	\
 	    listen recv recvfrom recvmsg send sendmsg sendto		\
 	    setsockopt shutdown socket socketpair isfdtype opensock	\
-	    sockatmark accept4
+	    sockatmark accept4 recvmmsg sendmmsg
 
 aux	 := have_sock_cloexec
 
diff --git a/socket/Versions b/socket/Versions
index 7a96b1e..b52f846 100644
--- a/socket/Versions
+++ b/socket/Versions
@@ -34,4 +34,10 @@ libc {
   GLIBC_2.10 {
     accept4;
   }
+  GLIBC_2.16 {
+    # functions used in other libraries
+    __sendmmsg;
+
+    recvmmsg; sendmmsg;
+  }
 }
diff --git a/socket/recvmmsg.c b/socket/recvmmsg.c
new file mode 100644
index 0000000..0bc6450
--- /dev/null
+++ b/socket/recvmmsg.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 2012 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 <errno.h>
+#include <sys/socket.h>
+
+/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
+   Returns the number of bytes read or -1 for errors.  */
+int
+__recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	    const struct timespec *tmo)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+libc_hidden_def (__recvmmsg)
+
+weak_alias (__recvmmsg, recvmmsg)
+
+stub_warning (recvmmsg)
diff --git a/socket/sendmmsg.c b/socket/sendmmsg.c
new file mode 100644
index 0000000..f717037
--- /dev/null
+++ b/socket/sendmmsg.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2012 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 <errno.h>
+#include <sys/socket.h>
+
+/* Send a VLEN messages as described by VMESSAGES to socket FD.
+   Returns the number of datagrams successfully written or -1 for errors.  */
+int
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+libc_hidden_def (__sendmmsg)
+
+weak_alias (__sendmmsg, sendmmsg)
+
+stub_warning (sendmmsg)
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index 787c2b9..3810a37 100644
--- a/socket/sys/socket.h
+++ b/socket/sys/socket.h
@@ -97,6 +97,16 @@ typedef union { __SOCKADDR_ALLTYPES
 # undef __SOCKADDR_ONETYPE
 #endif
 
+#ifdef __USE_GNU
+/* For `recvmmsg' and `sendmmsg'.  */
+struct mmsghdr
+  {
+    struct msghdr msg_hdr;	/* Actual message header.  */
+    unsigned int msg_len;	/* Number of received or sent bytes for the
+				   entry.  */
+  };
+#endif
+
 
 /* Create a new socket of type TYPE in domain DOMAIN, using
    protocol PROTOCOL.  If PROTOCOL is zero, one is chosen automatically.
@@ -175,6 +185,16 @@ extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
 extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
 			int __flags);
 
+#ifdef __USE_GNU
+/* Send a VLEN messages as described by VMESSAGES to socket FD.
+   Returns the number of datagrams successfully written or -1 for errors.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
+		     unsigned int __vlen, int __flags);
+#endif
+
 /* Receive a message as described by MESSAGE from socket FD.
    Returns the number of bytes read or -1 for errors.
 
@@ -182,6 +202,17 @@ extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
    __THROW.  */
 extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
 
+#ifdef __USE_GNU
+/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
+   Returns the number of bytes read or -1 for errors.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
+		     unsigned int __vlen, int __flags,
+		     const struct timespec *__tmo);
+#endif
+
 
 /* Put the current value for socket FD's option OPTNAME at protocol level LEVEL
    into OPTVAL (which is *OPTLEN bytes long), and set *OPTLEN to the value's
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index ddae686..3ca394d 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -12,8 +12,7 @@ CFLAGS-malloc.c += -DMORECORE_CLEARS=2
 endif
 
 ifeq ($(subdir),socket)
-sysdep_routines += internal_accept4 recvmmsg internal_recvmmsg sendmmsg \
-		   internal_sendmmsg
+sysdep_routines += internal_accept4 internal_recvmmsg internal_sendmmsg
 endif
 
 ifeq ($(subdir),misc)
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 309cba7..df8f167 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -235,16 +235,6 @@ struct msghdr
     int msg_flags;		/* Flags on received message.  */
   };
 
-#ifdef __USE_GNU
-/* For `recvmmsg' and 'sendmmsg'.  */
-struct mmsghdr
-  {
-    struct msghdr msg_hdr;	/* Actual message header.  */
-    unsigned int msg_len;	/* Number of received or sent bytes
-				   for the entry.  */
-  };
-#endif
-
 /* Structure used for storage of ancillary data object information.  */
 struct cmsghdr
   {
@@ -389,27 +379,4 @@ struct linger
     int l_linger;		/* Time to linger.  */
   };
 
-
-__BEGIN_DECLS
-
-#ifdef __USE_GNU
-/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
-   Returns the number of bytes read or -1 for errors.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
-		     unsigned int __vlen, int __flags,
-		     const struct timespec *__tmo);
-
-/* Send a VLEN messages as described by VMESSAGES to socket FD.
-   Return the number of datagrams successfully written or -1 for errors.
-This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
-		     unsigned int __vlen, int __flags);
-#endif
-
-__END_DECLS
-
 #endif	/* bits/socket.h */
diff --git a/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist b/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
index d6695eb..27e3148 100644
--- a/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
@@ -1804,6 +1804,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/internal_recvmmsg.S b/sysdeps/unix/sysv/linux/internal_recvmmsg.S
index 66c1357..18e6da8 100644
--- a/sysdeps/unix/sysv/linux/internal_recvmmsg.S
+++ b/sysdeps/unix/sysv/linux/internal_recvmmsg.S
@@ -2,13 +2,14 @@
 #include <sys/syscall.h>
 #if !defined __NR_recvmmsg && defined __NR_socketcall
 # define socket	recvmmsg
-# ifdef __ASSUME_RECVMMSG
-#  define __socket recvmmsg
-# else
+# ifndef __ASSUME_RECVMMSG
 #  define __socket __internal_recvmmsg
+#  define NO_WEAK_ALIAS
 # endif
 # define NARGS 5
 # define NEED_CANCELLATION
-# define NO_WEAK_ALIAS
 # include <socket.S>
+# ifdef __ASSUME_RECVMMSG
+libc_hidden_def (__recvmmsg)
+# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/internal_sendmmsg.S b/sysdeps/unix/sysv/linux/internal_sendmmsg.S
index f5152c9..e6681f0 100644
--- a/sysdeps/unix/sysv/linux/internal_sendmmsg.S
+++ b/sysdeps/unix/sysv/linux/internal_sendmmsg.S
@@ -2,13 +2,14 @@
 #include <sys/syscall.h>
 #if !defined __NR_sendmmsg && defined __NR_socketcall
 # define socket	sendmmsg
-# ifdef __ASSUME_SENDMMSG
-#  define __socket sendmmsg
-# else
+# ifndef __ASSUME_SENDMMSG
 #  define __socket __internal_sendmmsg
+#  define NO_WEAK_ALIAS
 # endif
 # define NARGS 4
 # define NEED_CANCELLATION
-# define NO_WEAK_ALIAS
 # include <socket.S>
+# ifdef __ASSUME_SENDMMSG
+libc_hidden_def (__sendmmsg)
+# endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
index 706d2a9..2049d54 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist
@@ -1765,6 +1765,7 @@ GLIBC_2.16
  __mcount_internal F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
index a0d362e..fcb4690 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist
@@ -71,6 +71,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
index 32fc8df..782b933 100644
--- a/sysdeps/unix/sysv/linux/recvmmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Schwab <schwab@redhat.com>, 2010.
 
@@ -26,8 +26,8 @@
 
 #ifdef __NR_recvmmsg
 int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
-	  const struct timespec *tmo)
+__recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	    const struct timespec *tmo)
 {
   if (SINGLE_THREAD_P)
     return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo);
@@ -40,6 +40,9 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
 
   return result;
 }
+libc_hidden_def (__recvmmsg)
+
+weak_alias (__recvmmsg, recvmmsg)
 #elif defined __NR_socketcall
 # ifndef __ASSUME_RECVMMSG
 extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages,
@@ -50,8 +53,8 @@ extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages,
 static int have_recvmmsg;
 
 int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
-	  const struct timespec *tmo)
+__recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
+	    const struct timespec *tmo)
 {
   if (__builtin_expect (have_recvmmsg >= 0, 1))
     {
@@ -84,16 +87,13 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__recvmmsg)
+
+weak_alias (__recvmmsg, recvmmsg)
 # else
-/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S.  */
+/* When __ASSUME_RECVMMSG, __recvmmsg and recvmmsg are defined in
+   internal_recvmmsg.S.  */
 # endif
 #else
-int
-recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
-	  const struct timespec *tmo)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-stub_warning (recvmmsg)
+# include <socket/recvmmsg.c>
 #endif
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
index d565601..1a92072 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist
@@ -1756,6 +1756,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
index f161a51..e7d58b2 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist
@@ -77,6 +77,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/sendmmsg.c b/sysdeps/unix/sysv/linux/sendmmsg.c
index 0674419..606291a 100644
--- a/sysdeps/unix/sysv/linux/sendmmsg.c
+++ b/sysdeps/unix/sysv/linux/sendmmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -26,7 +26,7 @@
 
 #ifdef __NR_sendmmsg
 int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 {
   if (SINGLE_THREAD_P)
     return INLINE_SYSCALL (sendmmsg, 4, fd, vmessages, vlen, flags);
@@ -39,6 +39,9 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 
   return result;
 }
+libc_hidden_def (__sendmmsg)
+
+weak_alias (__sendmmsg, sendmmsg)
 #elif defined __NR_socketcall
 # ifndef __ASSUME_SENDMMSG
 extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages,
@@ -48,7 +51,7 @@ extern int __internal_sendmmsg (int fd, struct mmsghdr *vmessages,
 static int have_sendmmsg;
 
 int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
+__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 {
   if (__builtin_expect (have_sendmmsg >= 0, 1))
     {
@@ -81,15 +84,12 @@ sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
   __set_errno (ENOSYS);
   return -1;
 }
+libc_hidden_def (__sendmmsg)
+
+weak_alias (__sendmmsg, sendmmsg)
 # else
 /* When __ASSUME_SENDMMSG sendmmsg is defined in internal_sendmmsg.S.  */
 # endif
 #else
-int
-sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-stub_warning (sendmmsg)
+# include <socket/sendmmsg.c>
 #endif
diff --git a/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist b/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
index 7c1425f..320890c 100644
--- a/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/nptl/libc.abilist
@@ -76,6 +76,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
index 1804348..8923d66 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist
@@ -1757,6 +1757,7 @@ GLIBC_2.16
  __getshmlba F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  _sys_errlist D 0x220
  _sys_nerr D 0x4
  aligned_alloc F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
index 8571fa8..565fec1 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist
@@ -78,6 +78,7 @@ GLIBC_2.16
  __getshmlba F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  _sys_errlist D 0x440
  _sys_nerr D 0x4
  aligned_alloc F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
index 2a1b8e9..678d471 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist
@@ -73,6 +73,7 @@ GLIBC_2.16
  __getauxval F
  __poll_chk F
  __ppoll_chk F
+ __sendmmsg F
  aligned_alloc F
  c16rtomb F
  c32rtomb F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
index 13b1d91..59ffba6 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist
@@ -376,6 +376,7 @@ GLIBC_2.16
  __secure_getenv F
  __select F
  __send F
+ __sendmmsg F
  __setmntent F
  __setpgid F
  __sigaction F


GrÃÃe,
 Thomas

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]