LibCore: Add a system wrapper to pipe a file

This uses splice on Linux and mmap+write elsewhere to transfer a file to
a pipe. Note we cannot use sendfile because (at least on macOS) the
receiving fd must be a socket.
This commit is contained in:
Timothy Flynn 2025-10-08 08:01:14 -04:00 committed by Andreas Kling
parent 62e52640d0
commit e433dee543
Notes: github-actions[bot] 2025-10-14 11:42:14 +00:00
3 changed files with 35 additions and 0 deletions

View file

@ -403,4 +403,14 @@ ErrorOr<void> kill(pid_t pid, int signal)
return {};
}
ErrorOr<size_t> transfer_file_through_pipe(int source_fd, int target_fd, size_t source_offset, size_t source_length)
{
(void)source_fd;
(void)target_fd;
(void)source_offset;
(void)source_length;
return Error::from_string_literal("FIXME: Implement System::transfer_file_through_pipe on Windows (for HTTP disk cache)");
}
}