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

Rewrite using io_lifetimes crate / IO safety RFC #12

Closed
yoshuawuyts opened this issue Jul 16, 2021 · 4 comments
Closed

Rewrite using io_lifetimes crate / IO safety RFC #12

yoshuawuyts opened this issue Jul 16, 2021 · 4 comments

Comments

@yoshuawuyts
Copy link
Owner

https://io-experiment.sunfishcode.online/x86_64-unknown-linux-gnu/io_lifetimes/index.html now exists, which is an experimental implementation of the IO safety RFC. We should create a branch of this code which uses that instead of what we're currently doing. Not in the least to validate that the RFC enables what it promises to.

@yoshuawuyts yoshuawuyts changed the title Rewrite using io_lifetimes Rewrite using io_lifetimes crate / IO safety RFC Jul 16, 2021
@sunfishcode
Copy link
Collaborator

At a quick look, this looks like it should be straightforward. It should work to replace T: AsRawFd with T: AsFd, and then either do .as_fd().as_raw_fd() to get a raw fd to pass to libc, or use posish, a libc wrapper crate using io-lifetimes, letting you call flock without the .as_raw_fd() or the syscall(unsafe { ... }). Either way, I'd be happy to answer any questions!

@sunfishcode
Copy link
Collaborator

If anyone wants to do this, I'm happy to help, but otherwise I may look into doing this myself as fd-lock looks like a nice real-world testcase.

@yoshuawuyts
Copy link
Owner Author

@sunfishcode I may not have the bandwidth to, so please feel free to!

@WaffleLapkin
Copy link

Since #14 was merged, should this be closed?

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

No branches or pull requests

3 participants