Hello Laurent, On 07/22/2016 08:45 AM, Laurent Georget wrote:
recvmsg(2) never causes a "Broken pipe" error but the unix(7) man page implies that MSG_NOSIGNAL can be used in the flags of recvmsg(2) to avoid sending a SIGPIPE. Fixes Bug 137351. Signed-Off-By: Laurent Georget <laurent.georget@xxxxxxxxxx> --- man7/unix.7 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Hi Michael, I found the culprit line in unix(7). It can be misleading indeed because it that it makes sense to use MSG_NOSIGNAL as a flag to recvmsg(2) to avoid a SIGPIPE but recvmsg(2) actually never triggers such an error. I propose the patch below to fix this.
Thanks for delving into this and finding the page that had the problem reported in https://bugzilla.kernel.org/show_bug.cgi?id=137351 I applied a slightly somewhat different patch. See below.
Best regards, Laurent Georget diff --git a/man7/unix.7 b/man7/unix.7 index 82715f9..fce5eb2 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -515,12 +515,12 @@ Remote socket was closed on a stream socket. If enabled, a .B SIGPIPE is sent as well. -This can be avoided by passing the +Sending the signal can be avoided by passing the .B MSG_NOSIGNAL flag to .BR sendmsg (2) -or -.BR recvmsg (2). +.RB ( recvmsg (2) +never causes such an error).
I think the parenthetical comment isn't needed. The previous page text was obviously wrong, but we don't need to mention recvmsg() in the fix.
.TP .B EPROTONOSUPPORT Passed protocol is not
I applied this patch: [[ diff --git a/man7/unix.7 b/man7/unix.7 index e111734..0d44dd6 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -518,9 +518,9 @@ is sent as well. This can be avoided by passing the .B MSG_NOSIGNAL flag to -.BR sendmsg (2) +.BR send (2) or -.BR recvmsg (2). +.BR sendmsg (2). .TP .B EPROTONOSUPPORT Passed protocol is not ]] Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html