Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add missing RecvFlags for recvmsg #1287

Closed
mstoeckl opened this issue Jan 24, 2025 · 1 comment · Fixed by #1288
Closed

Feature request: add missing RecvFlags for recvmsg #1287

mstoeckl opened this issue Jan 24, 2025 · 1 comment · Fixed by #1288
Labels
enhancement New feature or request

Comments

@mstoeckl
Copy link

Per man 3p recvmsg, recvmsg() may return the following flags:

  MSG_EOR     End-of-record was received (if supported by the protocol).
  MSG_OOB     Out-of-band data was received.
  MSG_TRUNC   Normal data was truncated.
  MSG_CTRUNC  Control data was truncated.

Currently RecvFlags contains the flags that may be passed to recvmsg, like OOB and TRUNC, but does not contain the flags which are only received, specifically EOR and CTRUNC.

sunfishcode added a commit that referenced this issue Jan 24, 2025
`RecvMsgReturn`'s `flags` field was previously `RecvFlags`, however
`recvmsg` returns a different set of flags than that. To address that,
add a new type, `ReturnFlags`, which contains the flags that are
returned from `recvmsg`.

Fixes #1287.
@sunfishcode
Copy link
Member

Makes sense. I've now submitted #1288 to implement that.

@sunfishcode sunfishcode added the enhancement New feature or request label Jan 24, 2025
sunfishcode added a commit that referenced this issue Jan 29, 2025
`RecvMsgReturn`'s `flags` field was previously `RecvFlags`, however
`recvmsg` returns a different set of flags than that. To address that,
add a new type, `ReturnFlags`, which contains the flags that are
returned from `recvmsg`.

Fixes #1287.
sunfishcode added a commit that referenced this issue Jan 30, 2025
* Add a new `ReturnFlags` type for flags returned from `recvmsg`

`RecvMsgReturn`'s `flags` field was previously `RecvFlags`, however
`recvmsg` returns a different set of flags than that. To address that,
add a new type, `ReturnFlags`, which contains the flags that are
returned from `recvmsg`.

Fixes #1287.

* Make `RecvMsgReturn`'s `Debug` impl not break no_std.

* Fix copypasta to avoid a unix domain socket collision.

* Windows lacks `MSG_EOR`.

* Fix VMIN/VEOF on AIX.

* Workaround limitations on Apple.

 - Disable `RecvFlags::TRUNC` on Apple.
 - Check for `AF_UNIX` socket addresses with no paths on Apple.

* Disable `RecvFlags::TRUNC` on illumos too.

* Disable `RecvFlags::TRUNC` on NetBSD too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants