From 868843fbf76dd67e804bc8a02121f5b56c560621 Mon Sep 17 00:00:00 2001
From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Date: Sat, 15 Jun 2019 14:48:29 +0200
Subject: Move function to padd a file with 0 bytes to libutil

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
---
 include/util.h | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'include')

diff --git a/include/util.h b/include/util.h
index 8e54cb4..28d21bc 100644
--- a/include/util.h
+++ b/include/util.h
@@ -3,6 +3,7 @@
 #define UTIL_H
 
 #include <sys/types.h>
+#include <stdint.h>
 
 /*
   Removes all preceeding and trailing slashes, shortens all sequences of
@@ -50,4 +51,10 @@ int pushdn(const char *path, size_t len);
 /* Returns 0 on success. On failure, prints error message to stderr. */
 int popd(void);
 
+/*
+  Write zero bytes to an output file to padd it to specified block size.
+  Returns 0 on success. On failure, prints error message to stderr.
+*/
+int padd_file(int outfd, uint64_t size, size_t blocksize);
+
 #endif /* UTIL_H */
-- 
cgit v1.2.3