aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/io.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-01-14 06:33:00 +0100
committerMattias Andrée <maandree@kth.se>2017-01-14 06:33:00 +0100
commitf29845d3bba7032c7f61d25a34441d9ab7ff8a4e (patch)
treead93ea361d9b678921868d814568b218bcf78383 /src/util/io.h
parentFix blind-stack and blind-concate (diff)
downloadblind-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/io.h')
-rw-r--r--src/util/io.h14
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);
+}