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

tests: create memory backed file in ram to do the file tests #128

Open
EdenQwQ opened this issue Jun 2, 2022 · 2 comments
Open

tests: create memory backed file in ram to do the file tests #128

EdenQwQ opened this issue Jun 2, 2022 · 2 comments
Assignees
Labels
Enhancement New feature or request Help wanted Extra attention is needed

Comments

@EdenQwQ
Copy link
Member

EdenQwQ commented Jun 2, 2022

This can be done with fnctl, memfd_create or other libc syscalls

@EdenQwQ EdenQwQ added Enhancement New feature or request Help wanted Extra attention is needed labels Jun 2, 2022
@Shinyzenith Shinyzenith assigned Shinyzenith and EdenQwQ and unassigned EdenQwQ Jun 3, 2022
@ajanon
Copy link
Collaborator

ajanon commented Oct 7, 2022

Is that really necessary?

Both the Filesystem Hierarchy Standard and POSIX mandate that /tmp exists. I think that on most Linux distributions, it is also a tmpfs mount where everything is kept in memory (or swap if needed). While I could not find any documentation stating that /tmp must be a tmpfs mount, I think it is rather safe to assume it is.

To be safer, we could use a dedicated temporary file crate (e.g. https://github.com/Stebalien/tempfile) which uses specific system calls internally to create temporary files.

@Shinyzenith
Copy link
Member

Is that really necessary?

Not really, just a nice-to-have.

Both the Filesystem Hierarchy Standard and POSIX mandate that /tmp exists. I think that on most Linux distributions, it is also a tmpfs mount where everything is kept in memory (or swap if needed). While I could not find any documentation stating that /tmp must be a tmpfs mount, I think it is rather safe to assume it is.

To be safer, we could use a dedicated temporary file crate (e.g. https://github.com/Stebalien/tempfile) which uses specific system calls internally to create temporary files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Help wanted Extra attention is needed
Development

No branches or pull requests

3 participants