Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Use the wasi crate. #20

Merged
merged 1 commit into from
Aug 19, 2019
Merged

Use the wasi crate. #20

merged 1 commit into from
Aug 19, 2019

Conversation

sunfishcode
Copy link
Member

I'm looking for feedback on whether this makes sense: Currently, the Rust libc crate provides declarations of the low-level WASI interfaces. We recently introduced a new wasi crate which provides these interfaces, and are considering removing them from libc. The wasi crate also provides safe wrappers around the wasi functions, which we can use here too (although we still do need some of our own wrappers, because it doesn't provide interfaces that use str, or allow us to test the values written into output parameters in error cases).

Switch from depending on libc to depending on the new wasi crate to provide
the low-level WASI interfaces.

See also rust-lang/libc#1461.
Copy link
Member

@kubkon kubkon left a comment

Choose a reason for hiding this comment

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

Intriguing! FWIW, I like the fact that with wasi crate, we got rid of the nasty __wasi_ for funcs, consts, types, etc. All in all, LGTM!

src/bin/close_preopen.rs Show resolved Hide resolved
@sunfishcode sunfishcode merged commit 6b2ce3a into master Aug 19, 2019
@sunfishcode sunfishcode deleted the wasi-crate branch August 19, 2019 19:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants