tools: add progress implementation
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I9da1674d6cbc688efc7bab0e033788d6ee4694f7
diff --git a/internal/sys.hpp b/internal/sys.hpp
index 2975b8c..265d251 100644
--- a/internal/sys.hpp
+++ b/internal/sys.hpp
@@ -12,6 +12,7 @@
#include <cinttypes>
#include <cstddef>
+#include <cstdint>
namespace internal
{
@@ -34,6 +35,7 @@
virtual int getpagesize() const = 0;
virtual int ioctl(int fd, unsigned long request, void* param) const = 0;
virtual int poll(struct pollfd* fds, nfds_t nfds, int timeout) const = 0;
+ virtual std::int64_t getSize(const char* pathname) const = 0;
};
/**
@@ -53,6 +55,8 @@
int getpagesize() const override;
int ioctl(int fd, unsigned long request, void* param) const override;
int poll(struct pollfd* fds, nfds_t nfds, int timeout) const override;
+ /* returns 0 on failure, or if the file is zero bytes. */
+ std::int64_t getSize(const char* pathname) const override;
};
/** @brief Default instantiation of sys */