Closed
Description
Hello. I'm currently trying to put a flock inside a mmap, and as it doesn't implement AsRawFd, memmap2 doesn't allow it. I have to do these shenanigans:
let mut file = unsafe { File::from_raw_fd(Flock::lock(file, FlockArg::LockExclusive).ok()?.as_raw_fd()) }; // SAFETY: Raw FD is copied from an existing file
Could AsRawFd be implemented into Flock?
Thank you,
Alex <3