# Re: \[PATCH v2\] recv.2: Document MSG\_CMSG\_CLOEXEC as returned in msg\_flags

- From: Alejandro Colomar \<alx@kernel.org\>
- Date: 2023-07-17 23:11:20 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2023/07/13330239
- Thread: https://ratatoskr.run/linux-man/2023/07/15929199/t.md

```text
Hi Matthew,

On 2023-07-17 01:47, Matthew House wrote:
> Signed-off-by: Matthew House <redacted>
> ---
> Clarified that the argument comes from the recvmsg() call. It feels a bit
> redundant to name recvmsg() again here, given that the list of flags is
> immediately preceded by, "The msg_flags field in the msghdr is set on
> return of recvmsg(). It can contain several flags: [...]" But I'll let you
> be the judge of that.
> 
>  man2/recv.2 | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/man2/recv.2 b/man2/recv.2
> index 660c103fb..1cd9f3e1b 100644
> --- a/man2/recv.2
> +++ b/man2/recv.2
> @@ -412,6 +412,15 @@ is returned to indicate that expedited or out-of-band data was received.
>  .B MSG_ERRQUEUE
>  indicates that no data was received but an extended error from the socket
>  error queue.
> +.TP
> +.BR MSG_CMSG_CLOEXEC " (since Linux 2.6.23)"
> +.\" commit 4a19542e5f694cd408a32c3d9dc593ba9366e2d7
> +indicates that
> +.B MSG_CMSG_CLOEXEC
> +was specified in the
> +.I flags
> +argument of
> +.BR recvmsg ().

I don't understand what's the purpose of this.  The kernel sets a bit
just to report to the caller that it set a bit?  No other purpose?
It feels very weird.  Of course, the caller already has that info,
doesn't it?

Thanks,
Alex

>  .SH RETURN VALUE
>  These calls return the number of bytes received, or \-1
>  if an error occurred.

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

```

## Attachments

- [OpenPGP\_signature](https://ratatoskr.run/linux-api/2023/07/13330239/attachment/0) (application/pgp-signature, 833 bytes)
