From f29845d3bba7032c7f61d25a34441d9ab7ff8a4e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 14 Jan 2017 06:33:00 +0100 Subject: Add definition checks for posix_fadvise flags + blind-concat: add -j MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util/io.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/io.h b/src/util/io.h index ac326c8..81b8f51 100644 --- a/src/util/io.h +++ b/src/util/io.h @@ -1,7 +1,8 @@ /* See LICENSE file for copyright and license details. */ -#define ewriteall(...) enwriteall(1, __VA_ARGS__) -#define ereadall(...) enreadall(1, __VA_ARGS__) +#define ewriteall(...) enwriteall(1, __VA_ARGS__) +#define ereadall(...) enreadall(1, __VA_ARGS__) +#define epwriteall(...) enpwriteall(1, __VA_ARGS__) int writeall(int fd, void *buf, size_t n); @@ -22,3 +23,12 @@ enreadall(int status, int fd, void *buf, size_t n, const char *fname) enprintf(status, "read %s:", fname); return (size_t)r; } + +int pwriteall(int fd, void *buf, size_t n, size_t ptr); + +static inline void +enpwriteall(int status, int fd, void *buf, size_t n, size_t ptr, const char *fname) +{ + if (pwriteall(fd, buf, n, ptr)) + enprintf(status, "pwrite %s:", fname); +} -- cgit v1.2.3-70-g09d2