Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU99 extracted _XOPEN_SOURCE to config.h. #110

Merged
merged 1 commit into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ AC_CHECK_HEADERS([fcntl.h libintl.h stdlib.h string.h strings.h sys/ioctl.h sys/
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([getpagesize gettimeofday memset mkdir pow putenv realpath regcomp sqrt strcasecmp strchr strerror strncasecmp strstr uname statfs statvfs])
AC_CHECK_FUNCS([sysconf gettimeofday memset mkdir pow putenv realpath regcomp sqrt strcasecmp strchr strerror strncasecmp strstr uname statfs statvfs])
AC_SEARCH_LIBS([sqrt], [m], [],
[AC_MSG_ERROR([Math library not found])])

Expand All @@ -76,6 +76,8 @@ AS_IF([test "$ac_cv_header_gpfs_h" = "yes" -o "$ac_cv_header_gpfs_fcntl_h" = "ye
# Check for system capabilities
AC_SYS_LARGEFILE

AC_DEFINE([_XOPEN_SOURCE], [700], [C99 compatibility])

# Check for lustre availability
AC_ARG_WITH([lustre],
[AS_HELP_STRING([--with-lustre],
Expand Down Expand Up @@ -254,12 +256,6 @@ Consider --with-aws4c=, CPPFLAGS, LDFLAGS, etc])
])








# Enable building "IOR", in all capitals
AC_ARG_ENABLE([caps],
[AS_HELP_STRING([--enable-caps],
Expand Down
2 changes: 0 additions & 2 deletions src/aiori-DUMMY.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# include "config.h"
#endif

#define _XOPEN_SOURCE 700

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down
2 changes: 0 additions & 2 deletions src/aiori-MMAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# include "config.h"
#endif

#define _XOPEN_SOURCE 700

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

Expand Down
2 changes: 0 additions & 2 deletions src/aiori.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
# include "config.h"
#endif

#define _XOPEN_SOURCE 700

#include <assert.h>
#include <stdbool.h>

Expand Down
8 changes: 3 additions & 5 deletions src/ior.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# include "config.h"
#endif

#define _XOPEN_SOURCE 700

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Expand Down Expand Up @@ -466,10 +464,10 @@ static void *aligned_buffer_alloc(size_t size)
char *buf, *tmp;
char *aligned;

#ifdef HAVE_GETPAGESIZE
size_t pageSize = getpagesize();
#else
#ifdef HAVE_SYSCONF
long pageSize = sysconf(_SC_PAGESIZE);
#else
size_t pageSize = getpagesize();
#endif

pageMask = pageSize - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/iordef.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# define srandom srand
# define random() (rand() * (RAND_MAX+1) + rand()) /* Note: only 30 bits */
# define sleep(X) Sleep((X)*1000)
# define getpagesize() 4096
# define sysconf(X) 4096
#else
# include <sys/param.h> /* MAXPATHLEN */
# include <unistd.h>
Expand Down
2 changes: 0 additions & 2 deletions src/mdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
* $Date: 2013/11/27 17:05:31 $
* $Author: brettkettering $
*/
#define _XOPEN_SOURCE 700

#include <limits.h>
#include <math.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion src/option.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
Expand Down
7 changes: 5 additions & 2 deletions src/parse_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include "config.h"
#endif

#define _XOPEN_SOURCE 700

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
Expand Down Expand Up @@ -53,7 +51,12 @@ static size_t NodeMemoryStringToBytes(char *size_str)
if (percent > 100 || percent < 0)
ERR("percentage must be between 0 and 100");

#ifdef HAVE_SYSCONF
page_size = sysconf(_SC_PAGESIZE);
#else
page_size = getpagesize();
#endif

#ifdef _SC_PHYS_PAGES
num_pages = sysconf(_SC_PHYS_PAGES);
if (num_pages == -1)
Expand Down