diff options
| author | Mattias Andrée <maandree@kth.se> | 2017-01-14 06:33:00 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2017-01-14 06:33:00 +0100 |
| commit | f29845d3bba7032c7f61d25a34441d9ab7ff8a4e (patch) | |
| tree | ad93ea361d9b678921868d814568b218bcf78383 /src/util | |
| parent | Fix blind-stack and blind-concate (diff) | |
| download | blind-f29845d3bba7032c7f61d25a34441d9ab7ff8a4e.tar.gz blind-f29845d3bba7032c7f61d25a34441d9ab7ff8a4e.tar.bz2 blind-f29845d3bba7032c7f61d25a34441d9ab7ff8a4e.tar.xz | |
Add definition checks for posix_fadvise flags + blind-concat: add -j
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/io.h | 14 |
1 files changed, 12 insertions, 2 deletions
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); +} |
