Use memfd_create on Linux once it becomes available in libc
Closed this issue · 0 comments
gnzlbg commented
This call to mkstemp
:
https://github.com/gnzlbg/slice_deque/blob/master/src/mirrored/linux.rs#L40
should be replaced by a memfd_create
call. When Linus Torvalds recommended using mkstemp
here:
I appreciate the carefulness of this, but why not just do
`static char filename[] = "/tmp/DoubleMapXXXXXX";` ` int fd = mkstemp(filename);`
which is rather simpler and does much less work
memfd_create
did not exist yet. The first step is:
- Finish my couple of weeks old PR to libc that adds
memfd_create
: rust-lang/libc#902
However, I'll probably end up stripping memfd_create
out-of-it because it is not exposed by glibc, so it shouldn't be exposed by libc either.
- We will need to either find a crate that exposes it (maybe use the
syscall.rs
crate ?), or create a small crate that just exposes it and add it as a linux dependency.
pinging @bill-myers because he is also interested in seeing this fixed