From 531ba156de326210e4807b701183eaf2f506cf2a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Oct 2025 18:13:16 +0200 Subject: [SERVER] iscsi refactor: First working version Work towards simplifying the iscsi implementation has begun. Goals are: - Simpler and easier to understand resource/lifecycle management of allocations - Single-threaded architecture, making locking unnecessary - Moving as many allocations as possible to the stack - Making the call-stack more shallow for easier tracking of code flow --- src/server/sendfile.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/server/sendfile.h (limited to 'src/server/sendfile.h') diff --git a/src/server/sendfile.h b/src/server/sendfile.h new file mode 100644 index 0000000..e4cc5b7 --- /dev/null +++ b/src/server/sendfile.h @@ -0,0 +1,18 @@ +#ifndef SENDFILE_H_ +#define SENDFILE_H_ + +#include +#include +#include + +/** + * Platform-agnostic wrapper around sendfile, with retry logic. + * @param fd file to read from + * @param sock socket to write to + * @param foffset offset in file to start reading from + * @param bytes number of bytes to read/send + * @return true on success + */ +bool sendfile_all(int fd, int sock, off_t foffset, size_t bytes); + +#endif \ No newline at end of file -- cgit v1.2.3-55-g7522