aboutsummaryrefslogtreecommitdiff
path: root/include/tar.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-07 14:44:17 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-07 14:46:40 +0200
commit267d5318e1cbf69a071b5188dda50310af2f2f8b (patch)
tree9b17035763ab4c69458f28fe37258713c45920a5 /include/tar.h
parent3a7d758d1d5a9b6499bdc3f75077932ba66f89d7 (diff)
Cleanup: Move padd_file function to libtar
It's only ever used for padding tarballs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/tar.h')
-rw-r--r--include/tar.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/tar.h b/include/tar.h
index d0a483c..e86d775 100644
--- a/include/tar.h
+++ b/include/tar.h
@@ -109,6 +109,8 @@ typedef struct {
#define TAR_MAGIC_OLD "ustar "
#define TAR_VERSION_OLD " "
+#define TAR_RECORD_SIZE (512)
+
/*
Returns < 0 on failure, > 0 if cannot encode, 0 on success.
Prints error/warning messages to stderr.
@@ -130,4 +132,10 @@ int read_header(int fd, tar_header_decoded_t *out);
void clear_header(tar_header_decoded_t *hdr);
+/*
+ Write zero bytes to an output file to padd it to the tar record size.
+ Returns 0 on success. On failure, prints error message to stderr.
+*/
+int padd_file(int outfd, sqfs_u64 size);
+
#endif /* TAR_H */