summary refs log tree commit diff
path: root/socket/sys
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-11-03 18:29:46 +0100
committerThomas Schwinge <thomas@codesourcery.com>2012-11-20 19:26:04 +0100
commit123be9deda8eb24ef15fb889248984e6d23bb8b4 (patch)
tree8d875402831e2eb1923b9d3ef8d88bcee14ad2c6 /socket/sys
parentcf9a5d186154b1ad4a8459fafa135dcd822e5f3b (diff)
downloadglibc-123be9deda8eb24ef15fb889248984e6d23bb8b4.tar.gz
glibc-123be9deda8eb24ef15fb889248984e6d23bb8b4.tar.xz
glibc-123be9deda8eb24ef15fb889248984e6d23bb8b4.zip
Add recvmmsg and sendmmsg to the generic glibc API.
Diffstat (limited to 'socket/sys')
-rw-r--r--socket/sys/socket.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/socket/sys/socket.h b/socket/sys/socket.h
index 787c2b907e..3810a37543 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