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

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