about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-12-08 20:10:46 -0800
committerUlrich Drepper <drepper@redhat.com>2009-12-08 20:10:46 -0800
commitee1a7fabb4e0abd3e73e828ce326dcb5fd38b874 (patch)
treea4e958d835b3c1b3ddf4480fb4bb5f5ca9da8fdc /sysdeps
parent406300d20a052a015dda915af632bc1d64af8394 (diff)
downloadglibc-ee1a7fabb4e0abd3e73e828ce326dcb5fd38b874.tar.gz
glibc-ee1a7fabb4e0abd3e73e828ce326dcb5fd38b874.tar.xz
glibc-ee1a7fabb4e0abd3e73e828ce326dcb5fd38b874.zip
Add recvmmsg interface.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/Versions2
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h27
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list1
3 files changed, 28 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 50c70513ff..f09ef6d983 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -146,6 +146,8 @@ libc {
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
     ntp_gettimex;
+
+    recvmmsg;
   }
   GLIBC_PRIVATE {
     # functions used in other libraries
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index f23b338a35..aa78087a72 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -234,8 +234,8 @@ enum
 #define	MSG_MORE	MSG_MORE
 
     MSG_CMSG_CLOEXEC	= 0x40000000	/* Set close_on_exit for file
-                                           descriptor received through
-                                           SCM_RIGHTS.  */
+					   descriptor received through
+					   SCM_RIGHTS.  */
 #define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
   };
 
@@ -259,6 +259,15 @@ struct msghdr
     int msg_flags;		/* Flags on received message.  */
   };
 
+#ifdef __USE_GNU
+/* For `recvmmsg'.  */
+struct mmsghdr
+  {
+    struct msghdr msg_hdr;	/* Actual message header.  */
+    unsigned int msg_len;	/* Number of received bytes for the entry.  */
+  };
+#endif
+
 /* Structure used for storage of ancillary data object information.  */
 struct cmsghdr
   {
@@ -403,4 +412,18 @@ struct linger
     int l_linger;		/* Time to linger.  */
   };
 
+
+__BEGIN_DECLS
+
+/* Receive a message as described by MESSAGE 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);
+
+__END_DECLS
+
 #endif	/* bits/socket.h */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index a87906a4e3..a1a449eb4b 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -53,6 +53,7 @@ prctl		EXTRA	prctl		i:iiiii	__prctl		prctl
 putpmsg		-	putpmsg		i:ippii	putpmsg
 query_module	EXTRA	query_module	i:sipip	query_module
 quotactl	EXTRA	quotactl	i:isip	quotactl
+recvmmsg	EXTRA	recvmmsg	Ci:ipiip	recvmmsg
 remap_file_pages -	remap_file_pages i:piiii	__remap_file_pages remap_file_pages
 sched_getp	-	sched_getparam	i:ip	__sched_getparam	sched_getparam
 sched_gets	-	sched_getscheduler	i:i	__sched_getscheduler	sched_getscheduler