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

Support processing ancillary outside rustix infrastructure #1008

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Support processing ancillary outside rustix infrastructure #1008

merged 1 commit into from
Feb 15, 2024

Conversation

SUPERCILEX
Copy link
Contributor

Specifically, I'm trying to parse control data from io_uring responses.

@SUPERCILEX

This comment was marked as resolved.

@notgull

This comment was marked as resolved.

@sunfishcode sunfishcode added the semver bump Issues that will require a semver-incompatible fix label Feb 5, 2024
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@SUPERCILEX

This comment was marked as resolved.

@sunfishcode

This comment was marked as resolved.

@SUPERCILEX

This comment was marked as resolved.

@sunfishcode sunfishcode removed the semver bump Issues that will require a semver-incompatible fix label Feb 15, 2024
@sunfishcode

This comment was marked as resolved.

Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two observations:

Looking at it now, it looks like a mistake to have AncillaryDrain hold read and length members. Rust standard library things like Vec::drain remove their elements even if the iterator is dropped without being iterated, so we should ideally do the same, and if we did, that would also eliminate this Option. However, we can do that in the next semver bump, because it is a subtle behavior change.

In general, it's a goal of rustix to provide safe APIs wherever possible, so this unsafe parse function is unforuntate, however a safe RecvMsg API for io_uring would be non-trivial, and possibly the best way thing to do within rustix is to just expose the unsafe primitives and look to higher-level crates to provide the safe abstractions on top of them.

@sunfishcode sunfishcode merged commit bbe8464 into bytecodealliance:main Feb 15, 2024
43 checks passed
@SUPERCILEX SUPERCILEX deleted the ancillary branch February 15, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants