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 wasi select, FD_SET, FD_ZERO, FD_ISSET #3681

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

youknowone
Copy link
Contributor

Please check if it fits in the project policy.

This is port of wasi-libc type definitions and functions. wasi-libc has different fd_set design to widely used one.

@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@tgross35
Copy link
Contributor

tgross35 commented Aug 13, 2024

Could you start a wasi file at libc-test/semver and add these? Also needs a rebase.

I believe this is the original source: https://github.com/WebAssembly/wasi-libc/blob/230d4be6c54bec93181050f9e25c87150506bdd0/libc-bottom-half/headers/public/__fd_set.h and https://github.com/WebAssembly/wasi-libc/blob/230d4be6c54bec93181050f9e25c87150506bdd0/libc-bottom-half/headers/public/__typedef_fd_set.h#L10-L12

@tgross35
Copy link
Contributor

@rustbot author

@youknowone
Copy link
Contributor Author

@rustbot review

@tgross35
Copy link
Contributor

Thanks!

This is fine as-is, but please consider adding FD_CLR and FD_COPY as a followup PR so we have all the functions in that file.

@tgross35 tgross35 added this pull request to the merge queue Aug 15, 2024
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 15, 2024
Merged via the queue into rust-lang:main with commit 50b4720 Aug 15, 2024
39 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 15, 2024
(backport <rust-lang#3681>)
(cherry picked from commit 1edaad1)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 15, 2024
(backport <rust-lang#3681>)
(cherry picked from commit e9da8a0)
@tgross35 tgross35 mentioned this pull request Aug 15, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Aug 15, 2024
@tgross35
Copy link
Contributor

@youknowone it looks like this isn't working when the rustc-dep-of-std feature is enabled (which is how std is allowed to have dependencies), see here rust-lang/rust#129226 (comment). Could you put up a fix for it? You should just need to update this line to include super::{Send, Sync, iter::Iterator}:

use super::{Send, Sync};

Try the build locally, you may also need #[allow(unused_imports)] if Cargo complains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants