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

Use memfd_create on Linux once it becomes available in libc #12

Closed
2 tasks
gnzlbg opened this issue Jan 18, 2018 · 0 comments
Closed
2 tasks

Use memfd_create on Linux once it becomes available in libc #12

gnzlbg opened this issue Jan 18, 2018 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@gnzlbg
Copy link
Owner

gnzlbg commented Jan 18, 2018

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:

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

@gnzlbg gnzlbg added the enhancement New feature or request label Feb 1, 2018
@gnzlbg gnzlbg added this to the 0.2 release milestone Feb 1, 2018
bors bot added a commit that referenced this issue Mar 7, 2018
30: use memfd_create instead of mkstemp r=gnzlbg a=gnzlbg

Closes #12 .

@bill-myers
@bors bors bot closed this as completed in #30 Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant