Closed yoshuawuyts closed 3 months ago
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!
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.
@sunfishcode I may not have the bandwidth to, so please feel free to!
Since #14 was merged, should this be closed?
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.