Blame SOURCES/1422950-mpo-7.5.2-recvmmsg.2-sendmmsg.2.patch

7dd887
From 8866991164690817cc1e3489b6f7aa615170935d Mon Sep 17 00:00:00 2001
7dd887
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
7dd887
Date: Wed, 10 Jan 2018 11:38:35 +0100
7dd887
Subject: [PATCH] recvmmsg.2, sendmmsg.2: point out that error handling is
7dd887
 unreliable
7dd887
7dd887
---
7dd887
 man-pages/man2/recvmmsg.2 | 10 ++++++++++
7dd887
 man-pages/man2/sendmmsg.2 |  9 +++++++++
7dd887
 2 files changed, 19 insertions(+)
7dd887
7dd887
diff --git a/man-pages/man2/recvmmsg.2 b/man-pages/man2/recvmmsg.2
7dd887
index 4c00ebe..7fc4d5a 100644
7dd887
--- a/man-pages/man2/recvmmsg.2
7dd887
+++ b/man-pages/man2/recvmmsg.2
7dd887
@@ -162,6 +162,8 @@ In addition, the following error can occur:
7dd887
 .B EINVAL
7dd887
 .I timeout
7dd887
 is invalid.
7dd887
+.PP
7dd887
+See also BUGS.
7dd887
 .SH VERSIONS
7dd887
 The
7dd887
 .BR recvmmsg ()
7dd887
@@ -170,6 +172,14 @@ Support in glibc was added in version 2.12.
7dd887
 .SH CONFORMING TO
7dd887
 .BR recvmmsg ()
7dd887
 is Linux-specific.
7dd887
+.SH BUGS
7dd887
+If an error occurs after at least one message has been received,
7dd887
+the call succeeds, and returns the number of messages received.
7dd887
+The error code is expected to be returned on a subsequent call to
7dd887
+.BR recvmmsq ().
7dd887
+In the current implementation, however, the error code can be overwritten
7dd887
+in the meantime by an unrelated network event on a socket,
7dd887
+for example an incoming ICMP packet.
7dd887
 .SH EXAMPLE
7dd887
 .PP
7dd887
 The following program uses
7dd887
diff --git a/man-pages/man2/sendmmsg.2 b/man-pages/man2/sendmmsg.2
7dd887
index a646524..939ee3c 100644
7dd887
--- a/man-pages/man2/sendmmsg.2
7dd887
+++ b/man-pages/man2/sendmmsg.2
7dd887
@@ -134,6 +134,7 @@ is set to indicate the error.
7dd887
 Errors are as for
7dd887
 .BR sendmsg (2).
7dd887
 An error is returned only if no datagrams could be sent.
7dd887
+See also BUGS.
7dd887
 .\" commit 728ffb86f10873aaf4abd26dde691ee40ae731fe
7dd887
 .\"     ... only return an error if no datagrams could be sent.
7dd887
 .\"     If less than the requested number of messages were sent, the application
7dd887
@@ -165,6 +166,14 @@ is capped to
7dd887
 .\"     For error handling an application using sendmmsg needs to retry at
7dd887
 .\"     the first unsent message, so capping is simpler and requires less
7dd887
 .\"     application logic than returning EINVAL.
7dd887
+.SH BUGS
7dd887
+If an error occurs after at least one message has been sent,
7dd887
+the call succeeds, and returns the number of messages sent.
7dd887
+The error code is lost.
7dd887
+The caller can retry the transmission,
7dd887
+starting at the first failed message, but there is no guarantee that,
7dd887
+if an error is returned, it will be the same as the one that was lost
7dd887
+on the previous call.
7dd887
 .SH EXAMPLE
7dd887
 The example below uses
7dd887
 .BR sendmmsg ()
7dd887
-- 
7dd887
2.13.6
7dd887