Skip to content

Commit

Permalink
Merge branch 'master' of github.com:blegat/benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Apr 24, 2014
2 parents a272301 + 8daf094 commit 4cd4f8d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions file/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>

#include "benchmark.h"

Expand Down
1 change: 1 addition & 0 deletions fork/fork.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

// mesure copy-on-write, also with pthread

Expand Down
6 changes: 6 additions & 0 deletions io/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>

#ifndef O_DIRECT
#warning O_DIRECT not defined on this platform
#define O_DIRECT 0
#endif

#include "benchmark.h"
#include "copy.h"

Expand Down
4 changes: 3 additions & 1 deletion lib/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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);
}

Expand Down
1 change: 1 addition & 0 deletions mmap/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "benchmark.h"
#include "copy.h"
Expand Down
1 change: 1 addition & 0 deletions mutsem/mutsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <string.h>
#include <semaphore.h>
#include <pthread.h>
#include <unistd.h>

#include "benchmark.h"

Expand Down
1 change: 1 addition & 0 deletions thread/thread.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

#include "benchmark.h"
Expand Down

0 comments on commit 4cd4f8d

Please sign in to comment.