diff --git a/file/file.c b/file/file.c index 179d933..22092ec 100644 --- a/file/file.c +++ b/file/file.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "benchmark.h" diff --git a/fork/fork.c b/fork/fork.c index bca935c..900c2a8 100644 --- a/fork/fork.c +++ b/fork/fork.c @@ -1,5 +1,6 @@ #include #include +#include // mesure copy-on-write, also with pthread diff --git a/io/io.c b/io/io.c index 9a9be73..a093b3c 100644 --- a/io/io.c +++ b/io/io.c @@ -11,8 +11,14 @@ #define _GNU_SOURCE #include #include +#include #include +#ifndef O_DIRECT +#warning O_DIRECT not defined on this platform +#define O_DIRECT 0 +#endif + #include "benchmark.h" #include "copy.h" diff --git a/lib/copy.c b/lib/copy.c index 657ffbe..240302f 100644 --- a/lib/copy.c +++ b/lib/copy.c @@ -118,7 +118,9 @@ void read_write (timer *t, recorder *rec, char *in, char *out, char *s = NULL; err = posix_memalign((void **) &s, 512, len); if (err != 0) { - error(0, err, "posix_memalign"); + // The value of errno is indeterminate after a call to posix_memalign() + errno = err; // so set it to use perror() + perror("posix_memalign"); exit(EXIT_FAILURE); } diff --git a/mmap/mmap.c b/mmap/mmap.c index 7f3a5a9..c79b5c5 100644 --- a/mmap/mmap.c +++ b/mmap/mmap.c @@ -5,6 +5,7 @@ #include #include +#include #include "benchmark.h" #include "copy.h" diff --git a/mutsem/mutsem.c b/mutsem/mutsem.c index f85bac4..4def923 100644 --- a/mutsem/mutsem.c +++ b/mutsem/mutsem.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "benchmark.h" diff --git a/thread/thread.c b/thread/thread.c index a8549eb..3cedef1 100644 --- a/thread/thread.c +++ b/thread/thread.c @@ -1,5 +1,6 @@ #include #include +#include #include #include "benchmark.h"