+2011-11-02 Bruno Haible <bruno@clisp.org>
+
+ New module 'fchmodat', split off from module 'openat'.
+ * lib/openat.h (chmodat, lchmodat): Enable only if GNULIB_FCHMODAT is
+ defined.
+ * m4/fchmodat.m4: New file, extracted from m4/openat.m4.
+ * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHMODAT. Don't test
+ for fchmodat, lchmod. Don't set HAVE_FCHMODAT.
+ * modules/fchmodat: New file, extracted from modules/openat.
+ * modules/openat (Files): Remove lib/fchmodat.c.
+ (configure.ac): Remove AC_LIBOBJ of fchmodat.
+ * modules/fchmodat-tests: New file, extracted from modules/openat-tests.
+ * modules/openat-tests (Files): Remove tests/test-fchmodat.c.
+ (Makefile.am): Remove rules for test-fchmodat.
+ * doc/posix-functions/fchmodat.texi: Mention module 'fchmodat' instead
+ of module 'openat'.
+ * NEWS: Mention the change.
+
2011-11-02 Jim Meyering <meyering@redhat.com>
putenv: indent #definition of "environ" to placate cppi
Date Modules Changes
+2011-11-01 openat This module no longer provides the fchmodat()
+ function. If you need this function, you now need
+ to request the 'fchmodat' module.
+
2011-11-01 alignof This module no longer provides the alignof() macro.
Use either alignof_slot() or alignof_type() instead.
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/fchmodat.html}
-Gnulib module: openat
+Gnulib module: fchmodat
Portability problems fixed by Gnulib:
@itemize
#endif
+#if GNULIB_FCHMODAT
+
static inline int
chmodat (int fd, char const *file, mode_t mode)
{
return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
}
+#endif
+
static inline int
statat (int fd, char const *name, struct stat *st)
{
--- /dev/null
+# fchmodat.m4 serial 1
+dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_FCHMODAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([fchmodat lchmod])
+ if test $ac_cv_func_fchmodat != yes; then
+ HAVE_FCHMODAT=0
+ fi
+])
-# serial 38
+# serial 39
# See if we need to use our replacement for Solaris' openat et al functions.
dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
GNULIB_OPENAT=1
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- GNULIB_FCHMODAT=1
GNULIB_FSTATAT=1
GNULIB_MKDIRAT=1
GNULIB_UNLINKAT=1
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([fchmodat lchmod mkdirat openat unlinkat])
+ AC_CHECK_FUNCS_ONCE([mkdirat openat unlinkat])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_REQUIRE([gl_FUNC_UNLINK])
case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in
HAVE_UNLINKAT=0 # No known system with unlinkat but not openat
gl_PREREQ_OPENAT;;
esac
- if test $ac_cv_func_fchmodat != yes; then
- HAVE_FCHMODAT=0
- fi
if test $ac_cv_func_mkdirat != yes; then
HAVE_MKDIRAT=0
fi
--- /dev/null
+Description:
+fchmodat() function: Change access permissions of a file at a directory.
+
+Files:
+lib/fchmodat.c
+lib/at-func.c
+lib/openat.h
+lib/openat-priv.h
+m4/fchmodat.m4
+
+Depends-on:
+dirent
+dosname
+errno
+extensions
+fchdir
+fcntl-h
+openat
+save-cwd
+stdbool
+sys_stat
+unistd
+
+configure.ac:
+gl_FUNC_FCHMODAT
+if test $HAVE_FCHMODAT = 0; then
+ AC_LIBOBJ([fchmodat])
+fi
+AC_REQUIRE([AC_C_INLINE]) dnl because 'inline' is used in lib/openat.h
+gl_MODULE_INDICATOR([fchmodat]) dnl for lib/openat.h
+gl_SYS_STAT_MODULE_INDICATOR([fchmodat])
+
+Makefile.am:
+
+Include:
+<sys/stat.h>
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering, Eric Blake
--- /dev/null
+Files:
+tests/test-fchmodat.c
+tests/signature.h
+tests/macros.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-fchmodat
+check_PROGRAMS += test-fchmodat
+test_fchmodat_LDADD = $(LDADD) @LIBINTL@
Files:
lib/at-func.c
-lib/fchmodat.c
lib/fstatat.c
lib/mkdirat.c
lib/openat.c
configure.ac:
gl_FUNC_OPENAT
AC_LIBOBJ([openat-proc])
-if test $HAVE_FCHMODAT = 0; then
- AC_LIBOBJ([fchmodat])
-fi
if test $ac_cv_func_fstatat = no || test $REPLACE_FSTATAT = 1; then
AC_LIBOBJ([fstatat])
fi
tests/test-mkdirat.c
tests/test-openat.c
tests/test-unlinkat.c
-tests/test-fchmodat.c
tests/signature.h
tests/macros.h
Makefile.am:
TESTS += \
- test-fchmodat test-fstatat test-mkdirat test-openat test-unlinkat
+ test-fstatat test-mkdirat test-openat test-unlinkat
check_PROGRAMS += \
- test-fchmodat test-fstatat test-mkdirat test-openat test-unlinkat
-test_fchmodat_LDADD = $(LDADD) @LIBINTL@
+ test-fstatat test-mkdirat test-openat test-unlinkat
test_fstatat_LDADD = $(LDADD) @LIBINTL@
test_mkdirat_LDADD = $(LDADD) @LIBINTL@
test_openat_LDADD = $(LDADD) @LIBINTL@