summaryrefslogtreecommitdiff
path: root/lib/sys_stat.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-02-09 00:44:11 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-02-09 00:45:42 -0800
commit5e7bead8eac9a79dfd74452a7bd5199f12ad0c45 (patch)
tree449a49b0635fc2f8d6acb43bcbaabf6621de4015 /lib/sys_stat.in.h
parent2645ae1222db1df270276b227e5102884466ecb0 (diff)
downloademacs-5e7bead8eac9a79dfd74452a7bd5199f12ad0c45.tar.gz
Update from Gnulib
This incorporates: 2020-02-08 lchmod: ensure declaration on HP-UX 2020-02-08 fchmodat: fix endless recursion on Cygwin 2020-02-08 Fix compilation errors in a testdir 2020-02-07 fchmodat: AT_SYMLINK_NOFOLLOW fix for non-symlinks 2020-02-04 Port _Noreturn to older Clang 2020-02-03 libc-config: port to Appleā€™s Clang variant * lib/_Noreturn.h, lib/c++defs.h, lib/libc-config.h, lib/sys_stat.in.h: * m4/gnulib-common.m4, m4/sys_stat_h.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
Diffstat (limited to 'lib/sys_stat.in.h')
-rw-r--r--lib/sys_stat.in.h41
1 files changed, 23 insertions, 18 deletions
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index c1e3243c1fe..e3ab3153fbf 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -392,13 +392,25 @@ struct stat
#if @GNULIB_FCHMODAT@
-# if !@HAVE_FCHMODAT@
+# if @REPLACE_FCHMODAT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef fchmodat
+# define fchmodat rpl_fchmodat
+# endif
+_GL_FUNCDECL_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchmodat, int,
+ (int fd, char const *file, mode_t mode, int flag));
+# else
+# if !@HAVE_FCHMODAT@
_GL_FUNCDECL_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag)
_GL_ARG_NONNULL ((2)));
-# endif
+# endif
_GL_CXXALIAS_SYS (fchmodat, int,
(int fd, char const *file, mode_t mode, int flag));
+# endif
_GL_CXXALIASWARN (fchmodat);
#elif defined GNULIB_POSIXCHECK
# undef fchmodat
@@ -502,31 +514,24 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
#if @GNULIB_LCHMOD@
/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
denotes a symbolic link. */
-# if !@HAVE_LCHMOD@
-/* The lchmod replacement follows symbolic links. Callers should take
- this into account; lchmod should be applied only to arguments that
- are known to not be symbolic links. On hosts that lack lchmod,
- this can lead to race conditions between the check and the
- invocation of lchmod, but we know of no workarounds that are
- reliable in general. You might try requesting support for lchmod
- from your operating system supplier. */
+# if @REPLACE_LCHMOD@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define lchmod chmod
+# undef lchmod
+# define lchmod rpl_lchmod
# endif
-/* Need to cast, because on mingw, the second parameter of chmod is
- int mode. */
-_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
- (const char *filename, mode_t mode));
+_GL_FUNCDECL_RPL (lchmod, int,
+ (char const *filename, mode_t mode)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (lchmod, int,
+ (char const *filename, mode_t mode));
# else
-# if 0 /* assume already declared */
+# if !@HAVE_LCHMOD@ || defined __hpux
_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
_GL_ARG_NONNULL ((1)));
# endif
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
# endif
-# if @HAVE_LCHMOD@
_GL_CXXALIASWARN (lchmod);
-# endif
#elif defined GNULIB_POSIXCHECK
# undef lchmod
# if HAVE_RAW_DECL_LCHMOD