-
If a parent enclave writes to tmpfs and then creates a child with either fork or execvp, does the instance of tmpfs survive or is a new instance? |
Beta Was this translation helpful? Give feedback.
Answered by
dimakuv
Sep 4, 2024
Replies: 1 comment 3 replies
-
Current tmpfs implementation says this: gramine/libos/src/fs/tmpfs/fs.c Lines 8 to 10 in a20d5b8 So, the child process/enclave will only get those tmpfs files that are currently being open. To illustrate with an example, int fd1 = open("tmpfs/file1");
write(fd1, "some text");
int fd2 = open("tmpfs/file2");
write(fd2, "some other text");
close(fd2);
fork();
// child gets only fd1 and its associated file "file1" |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nothing bad. The file "file1" with its contents will still be there in the child.