mirror of
https://github.com/clearlinux/graphene.git
synced 2026-10-03 23:48:19 +00:00
Previously, Graphene would fail if application uses sendfile() on a protected file. This happened because LibOS's emulation of sendfile relies on PAL to allocate a temporary buffer for mmapped contents, however mmap implementation in PFs did not allocate this buffer. This commit adds logic in PFs to allocate the buffer (it is the responsibility of LibOS to free it later). Also, since PFs propagate changes to writable files only on flush/close, sendfile is augmented with a forced flush. A sendfile test is added to FS/PF tests.
7 lines
217 B
C
7 lines
217 B
C
#include "common.h"
|
|
|
|
void copy_data(int fi, int fo, const char* input_path, const char* output_path, size_t size) {
|
|
sendfile_fd(input_path, output_path, fi, fo, size);
|
|
printf("sendfile_fd(%zu) OK\n", size);
|
|
}
|