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

Add io_uring_buf_ring struct #1155

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Conversation

ryanseipp
Copy link
Contributor

Closes #1143.

Adds a new type io_uring_buf_ring, defined in the kernel here as:

struct io_uring_buf_ring {
	union {
		/*
		 * To avoid spilling into more pages than we need to, the
		 * ring tail is overlaid with the io_uring_buf->resv field.
		 */
		struct {
			__u64	resv1;
			__u32	resv2;
			__u16	resv3;
			__u16	tail;
		};
		struct io_uring_buf	bufs[0];
	};
};

linux-raw-sys exports the type here, so we can verify alignment and sizes of the types. Additionally, an integration test was added to ensure we can use the structs, anonymous union type, and flexible array member correctly.

@sunfishcode
Copy link
Member

Looks good, thanks!

@sunfishcode sunfishcode merged commit 3b9948a into bytecodealliance:main Nov 12, 2024
45 checks passed
sunfishcode pushed a commit that referenced this pull request Nov 18, 2024
sunfishcode pushed a commit that referenced this pull request Nov 18, 2024
@sunfishcode
Copy link
Member

This is now released in rustix 0.38.41.

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.

Feature request: Export io_uring_buf_ring
2 participants