aboutsummaryrefslogtreecommitdiff
path: root/libctf/configure.ac
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2019-06-04 15:04:49 +0100
committerNick Alcock <nick.alcock@oracle.com>2019-06-04 17:05:08 +0100
commitad118caa9f690114d11384b0813f30980cc333f3 (patch)
tree3261c7175a31eb17ae72c2a8f0d107c4d1ad9f59 /libctf/configure.ac
parent6b22174ff163b828a2069f22353018ca97fc0fb4 (diff)
downloadgdb-ad118caa9f690114d11384b0813f30980cc333f3.zip
gdb-ad118caa9f690114d11384b0813f30980cc333f3.tar.gz
gdb-ad118caa9f690114d11384b0813f30980cc333f3.tar.bz2
libctf: work on platforms without O_CLOEXEC.
(Not tested on any such platforms, since I don't have access to any at the moment. Testing encouraged.) libctf/ * configure.ac: Check for O_CLOEXEC. * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be. * config.h.in: Regenerate.
Diffstat (limited to 'libctf/configure.ac')
-rw-r--r--libctf/configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/libctf/configure.ac b/libctf/configure.ac
index beb90ba..2a1a80b 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -133,6 +133,22 @@ esac
AM_CONDITIONAL(NEED_CTF_QSORT_R, test "${ac_cv_libctf_qsort_r_signature}" = unknown)
+AC_CACHE_CHECK([for O_CLOEXEC], [ac_cv_libctf_macro_O_CLOEXEC],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+ ]],
+ [[return O_CLOEXEC;]])],
+ [ac_cv_libctf_macro_O_CLOEXEC=yes],
+ [ac_cv_libctf_macro_O_CLOEXEC=no])])
+
+if test $ac_cv_libctf_macro_O_CLOEXEC = yes; then
+ AC_DEFINE([HAVE_O_CLOEXEC], 1,
+ [Whether the platform has a definition of O_CLOEXEC.])
+fi
+
AC_CONFIG_FILES(Makefile)
AC_CONFIG_HEADERS(config.h)
AC_OUTPUT