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

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