Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
abt-io
Commits
b4ed21f5
Commit
b4ed21f5
authored
Jul 10, 2016
by
Philip Carns
Browse files
autoconf tests for O_DIRECT and mkostemp
parent
58d61f33
Changes
1
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
b4ed21f5
...
...
@@ -47,6 +47,43 @@ LIBS="$ABT_SNOOZER_LIBS $LIBS"
CPPFLAGS="$ABT_SNOOZER_CFLAGS $CPPFLAGS"
CFLAGS="$ABT_SNOOZER_CFLAGS $CFLAGS"
NONCOMPLIANT_IO=""
AC_MSG_CHECKING([for O_DIRECT])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
], [
int fd = open(NULL, O_DIRECT);
],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_ODIRECT], [], [Define if able to open files with O_DIRECT])
,
NONCOMPLIANT_IO=1
AC_MSG_RESULT(no))
AC_MSG_CHECKING([for mkostemp])
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <stdlib.h>
], [
int fd = mkostemp(NULL, 0);
],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_MKOSTEMP], [], [Define if mkostemp available])
,
NONCOMPLIANT_IO=1
AC_MSG_RESULT(no))
AC_CONFIG_FILES([Makefile maint/abt-io.pc])
AC_OUTPUT
if test "x$NONCOMPLIANT_IO" = "x1" ; then
AC_MSG_WARN([This platform lacks O_DIRECT and/or mkostemp(). All code
should still compile and pass make check tests, but behavior and
performance results in example programs may not match other platforms.])
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment