Update HACKING.
[gnulib.git] / m4 / openat.m4
blobe91f58f4afb7e92abd075a115e348d6bb8619398
1 # openat.m4
2 # serial 46
3 dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 # See if we need to use our replacement for Solaris' openat et al functions.
10 # Written by Jim Meyering.
12 AC_DEFUN([gl_FUNC_OPENAT],
14   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
15   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
16   AC_CHECK_FUNCS_ONCE([openat])
17   AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
18   AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
19   case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
20   yes+*yes+yes)
21     ;;
22   yes+*)
23     # Solaris 10 lacks O_CLOEXEC.
24     # Solaris 9 has *at functions, but uniformly mishandles trailing
25     # slash in all of them.
26     REPLACE_OPENAT=1
27     ;;
28   *)
29     HAVE_OPENAT=0
30     ;;
31   esac
34 # Prerequisites of lib/openat.c.
35 AC_DEFUN([gl_PREREQ_OPENAT],
37   AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
38   :