summaryrefslogtreecommitdiff
path: root/libstdc++-v3/configure
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2022-06-23 23:20:53 -0300
committerAlexandre Oliva <oliva@gnu.org>2022-06-23 23:28:14 -0300
commit93070671eae44f24ba822383e17571a39257c637 (patch)
treeec63cf8c4576857b089c6322d5e4a65c4d75d427 /libstdc++-v3/configure
parent5d8a5f04acec697c893e1c2263032bc01e2c2f2b (diff)
downloadgcc-93070671eae44f24ba822383e17571a39257c637.tar.gz
libstdc++: check for openat
rtems6.0 has fdopendir, and fcntl.h defines AT_FDCWD and declares openat, but there's no openat in libc. Adjust dir-common.h to not assume ::openat just because of AT_FDCWD. for libstdc++-v3/ChangeLog * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for openat. * configure, config.h.in: Rebuilt. * src/filesystem/dir-common.h (openat): Use ::openat if _GLIBCXX_HAVE_OPENAT. * src/filesystem/dir.cc (dir_and_pathname): Use dirfd if _GLIBCXX_HAVE_OPENAT.
Diffstat (limited to 'libstdc++-v3/configure')
-rwxr-xr-xlibstdc++-v3/configure55
1 files changed, 55 insertions, 0 deletions
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 9b94fd71e42..eac60392121 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -77178,6 +77178,61 @@ $as_echo "$glibcxx_cv_dirfd" >&6; }
$as_echo "#define HAVE_DIRFD 1" >>confdefs.h
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openat" >&5
+$as_echo_n "checking for openat... " >&6; }
+if ${glibcxx_cv_openat+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test x$gcc_no_link = xyes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+int
+main ()
+{
+int fd = ::openat(AT_FDCWD, "", 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_openat=yes
+else
+ glibcxx_cv_openat=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <fcntl.h>
+int
+main ()
+{
+int fd = ::openat(AT_FDCWD, "", 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ glibcxx_cv_openat=yes
+else
+ glibcxx_cv_openat=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_openat" >&5
+$as_echo "$glibcxx_cv_openat" >&6; }
+ if test $glibcxx_cv_openat = yes; then
+
+$as_echo "#define HAVE_OPENAT 1" >>confdefs.h
+
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unlinkat" >&5
$as_echo_n "checking for unlinkat... " >&6; }
if ${glibcxx_cv_unlinkat+:} false; then :