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

Backport patches to the 0.38 branch #1192

Merged
merged 12 commits into from
Oct 20, 2024
Merged

Backport patches to the 0.38 branch #1192

merged 12 commits into from
Oct 20, 2024

Conversation

sunfishcode
Copy link
Member

Backport several patches to the 0.38 branch.

sunfishcode and others added 12 commits October 17, 2024 16:54
In the `waitpid` tests, explicitly terminate the child processe and
wait for them to exit, as dropping a `Command` otherwise leaves the
process running. This fixes test hangs on macos.
According to [this page], the official site for the glibc documentation
is [here] now. Update URLs accordingly.

And add links for glibc's documentation for `pread`, `pwrite`,
`readv`, `writev`, `preadv2` and `pwritev2`.

[this page]: https://www.gnu.org/software/libc/manual/
[here]: https://sourceware.org/glibc/manual/
static mut is now discouraged; however it appears that the places we use
static mut can be removed pretty easily.

Signed-off-by: John Nunley <[email protected]>
Fixing low-hanging-fruit issue #1051.

Signed-off-by: John Nunley <[email protected]>
* Implement `select`.

Add a `select` function, defined only on platforms where it doesn't
have an `FD_SETSIZE` limitation.

* Fix test hangs on macos.

In the `waitpid` tests, ensure that the child process has exited, as
dropping `Command` otherwise leaves the process running. This fixes
test hangs on macos.

* Wait for the child process after signaling it.

* Fix the vector sizes in the test.

* Add `fd_set` and other convenience functions.

* Switch to a safe API.

* Support `select` on Linux and Windows too.

This uses a trick where we still allow users to allocate a
`FdSetElement` array, but we just allocate a `FD_SET` on Windows
out of it.

And make `select` unsafe due to I/O safety.

* Fix qemu to implment arbitrary-sized fd sets for `select`.

* Support WASI.

* Ignore "unstable name collisions" warnings for now.
These functions were added to libc 0.2.161, and are required by some downstream crates.
@sunfishcode sunfishcode merged commit c004964 into 0.38 Oct 20, 2024
45 checks passed
@sunfishcode sunfishcode deleted the 0.38-updates branch October 20, 2024 13: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.

6 participants