From f198ec1b8493adb8de8732fcba77512e76b7e265 Mon Sep 17 00:00:00 2001 From: Russell Sears Date: Wed, 13 Feb 2013 17:47:21 -0800 Subject: [PATCH] #define _GNU_SOURCE in files that need it (instead of globally). --- benchmarks/linearHashNTAMultiReader.c | 8 -------- benchmarks/rawIOPS.c | 3 +++ benchmarks/sequentialThroughput.c | 3 +++ config.h.cmake | 3 --- src/stasis/bufferManager/legacy/pageFile.c | 3 +++ src/stasis/flags.c | 5 ++++- src/stasis/io/file.c | 3 +++ src/stasis/io/pfile.c | 3 +++ 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/benchmarks/linearHashNTAMultiReader.c b/benchmarks/linearHashNTAMultiReader.c index 2fff47c..4758f34 100644 --- a/benchmarks/linearHashNTAMultiReader.c +++ b/benchmarks/linearHashNTAMultiReader.c @@ -6,14 +6,6 @@ #include #include -// if we're using linux's crazy version of the pthread header, -// it probably forgot to include PTHREAD_STACK_MIN - -#ifndef PTHREAD_STACK_MIN -#include -#endif - - int i = 0; int max_active = 0; diff --git a/benchmarks/rawIOPS.c b/benchmarks/rawIOPS.c index 49c901c..68ef890 100644 --- a/benchmarks/rawIOPS.c +++ b/benchmarks/rawIOPS.c @@ -4,6 +4,9 @@ * Created on: Aug 26, 2011 * Author: sears */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE // for O_DIRECT +#endif #include #include #include diff --git a/benchmarks/sequentialThroughput.c b/benchmarks/sequentialThroughput.c index 3d61089..6c196a5 100644 --- a/benchmarks/sequentialThroughput.c +++ b/benchmarks/sequentialThroughput.c @@ -1,3 +1,6 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE // for O_DIRECT +#endif #include #include diff --git a/config.h.cmake b/config.h.cmake index 2495e26..3eb8ca3 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,8 +1,5 @@ #ifndef STASIS_CONFIG_H #define STASIS_CONFIG_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #cmakedefine HAVE_POSIX_FALLOCATE #cmakedefine HAVE_POSIX_MEMALIGN #cmakedefine HAVE_POSIX_FADVISE diff --git a/src/stasis/bufferManager/legacy/pageFile.c b/src/stasis/bufferManager/legacy/pageFile.c index 5554de0..255ec05 100644 --- a/src/stasis/bufferManager/legacy/pageFile.c +++ b/src/stasis/bufferManager/legacy/pageFile.c @@ -3,6 +3,9 @@ This file handles all of the file I/O for pages. */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE // for sync file range constants. +#endif #include "config.h" #include diff --git a/src/stasis/flags.c b/src/stasis/flags.c index 670fc5c..d76d356 100644 --- a/src/stasis/flags.c +++ b/src/stasis/flags.c @@ -1,4 +1,7 @@ -#include //for O_NOATIME +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#include #include #include #include diff --git a/src/stasis/io/file.c b/src/stasis/io/file.c index 127654e..1a52466 100644 --- a/src/stasis/io/file.c +++ b/src/stasis/io/file.c @@ -1,3 +1,6 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE // for sync file range constants. +#endif #include #include #include diff --git a/src/stasis/io/pfile.c b/src/stasis/io/pfile.c index f3d2b9f..027b6a5 100644 --- a/src/stasis/io/pfile.c +++ b/src/stasis/io/pfile.c @@ -1,3 +1,6 @@ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE // for sync_file_range constants +#endif #include #include