about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/recvmmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/recvmmsg.c')
-rw-r--r--sysdeps/unix/sysv/linux/recvmmsg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/recvmmsg.c b/sysdeps/unix/sysv/linux/recvmmsg.c
index 04ff42ee72..57ddf3152a 100644
--- a/sysdeps/unix/sysv/linux/recvmmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmmsg.c
@@ -23,6 +23,14 @@
 #include <sys/syscall.h>
 #include <kernel-features.h>
 
+/* Do not use the recvmmsg syscall on socketcall architectures unless
+   it was added at the same time as the socketcall support or can be
+   assumed to be present.  */
+#if defined __ASSUME_SOCKETCALL \
+    && !defined __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL \
+    && !defined __ASSUME_RECVMMSG_SYSCALL
+# undef __NR_recvmmsg
+#endif
 
 #ifdef __NR_recvmmsg
 int
@@ -41,7 +49,7 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
   return result;
 }
 #elif defined __NR_socketcall
-# ifndef __ASSUME_RECVMMSG
+# ifndef __ASSUME_RECVMMSG_SOCKETCALL
 extern int __internal_recvmmsg (int fd, struct mmsghdr *vmessages,
 				unsigned int vlen, int flags,
 				const struct timespec *tmo)
@@ -85,7 +93,8 @@ recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
   return -1;
 }
 # else
-/* When __ASSUME_RECVMMSG recvmmsg is defined in internal_recvmmsg.S.  */
+/* When __ASSUME_RECVMMSG_SOCKETCALL recvmmsg is defined in
+   internal_recvmmsg.S.  */
 # endif
 #else
 # include <socket/recvmmsg.c>