linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Laurent Georget
	<laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	Ivan Kharpalev
	<ivan.kharpalev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] unix.7: Explain that MSG_NOSIGNAL is useless for recvmsg(2)
Date: Sun, 24 Jul 2016 21:32:09 +0200	[thread overview]
Message-ID: <9997abd3-141b-d225-ac82-415c6f34b8b9@gmail.com> (raw)
In-Reply-To: <20160722064522.5159-1-laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>

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-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
>
> ---
>  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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-07-24 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 21:06 [Bug 137351] New: MSG_NOSIGNAL not documented bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
     [not found] ` <bug-137351-11311-3bo0kxnWaOQUvHkbgXJLS5sdmw4N0Rt+2LY78lusg7I@public.gmane.org/>
2016-07-21 21:28   ` [Bug 137351] MSG_NOSIGNAL not documented in man 2 recv, OR misprint in man recvmsg in the line "This can be avoided by passing the MSG_NOSIGNAL flag to sendmsg(2) or recvmsg(2)." bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
2016-07-22  6:29   ` bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
2016-07-22  6:45   ` [PATCH] unix.7: Explain that MSG_NOSIGNAL is useless for recvmsg(2) Laurent Georget
     [not found]     ` <20160722064522.5159-1-laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org>
2016-07-24 19:32       ` Michael Kerrisk (man-pages) [this message]
2016-07-22  6:51   ` [Bug 137351] MSG_NOSIGNAL not documented in man 2 recv, OR misprint in man recvmsg in the line "This can be avoided by passing the MSG_NOSIGNAL flag to sendmsg(2) or recvmsg(2)." bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r
2016-07-24 20:35   ` bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9997abd3-141b-d225-ac82-415c6f34b8b9@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ivan.kharpalev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=laurent.georget-vbcOdlJ0SulGWvitb5QawA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).