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

Implement dup and O_TMPFILE #613

Merged
merged 2 commits into from
Oct 15, 2023
Merged

Implement dup and O_TMPFILE #613

merged 2 commits into from
Oct 15, 2023

Conversation

vlovich
Copy link
Contributor

@vlovich vlovich commented Oct 13, 2023

Make it possible to create an unnamed temporary file and to dup a DmaFile.

What does this PR do?

The file can be requested to be opened O_TMPFILE (i.e. new unnamed file in a directory) and DmaFile::dup will create a new DmaFile pointing to the exact same fd. This way we can create an unnamed file & create clones of it & (in the future) link it into the filesystem.

Motivation

I need to create a temporary file. Also I need the same file opened twice as a workaround for #605.

Related issues

Additional Notes

Checklist

[X] I have added unit tests to the code I am submitting
[] My unit tests cover both failure and success scenarios
[] If applicable, I have discussed my architecture

@vlovich vlovich force-pushed the file-dup branch 3 times, most recently from 6950712 to f05630d Compare October 13, 2023 22:34
Make it possible to create an unnamed temporary file and to dup a
DmaFile.
@glommer glommer merged commit b0eb0e2 into DataDog:master Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants