summaryrefslogtreecommitdiff
path: root/lib/gl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-10-15 08:34:52 +0200
committerSimon Josefsson <simon@josefsson.org>2009-10-15 08:34:52 +0200
commit5f30b74679828c8f0e18f42096d9651b00772aff (patch)
tree6ee9cbb2d290f19a19101ee6090eddeada26b44c /lib/gl
parent55aa014dffb9b95bc3ad55a3d17f92668e416088 (diff)
downloadgnutls-5f30b74679828c8f0e18f42096d9651b00772aff.tar.gz
Update gnulib files.
Diffstat (limited to 'lib/gl')
-rw-r--r--lib/gl/Makefile.am3
-rw-r--r--lib/gl/m4/gnulib-comp.m42
-rw-r--r--lib/gl/m4/sys_stat_h.m45
-rw-r--r--lib/gl/sys_stat.in.h26
-rw-r--r--lib/gl/tests/test-sys_stat.c27
-rw-r--r--lib/gl/unistd.in.h4
6 files changed, 62 insertions, 5 deletions
diff --git a/lib/gl/Makefile.am b/lib/gl/Makefile.am
index b631277da5..c1e87e2740 100644
--- a/lib/gl/Makefile.am
+++ b/lib/gl/Makefile.am
@@ -738,6 +738,7 @@ sys/stat.h: sys_stat.in.h
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
-e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
+ -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
-e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
-e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
@@ -746,6 +747,7 @@ sys/stat.h: sys_stat.in.h
-e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
-e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
-e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
-e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
-e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
-e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
@@ -753,6 +755,7 @@ sys/stat.h: sys_stat.in.h
-e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
-e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
-e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
-e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
-e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
-e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index 7f3142d5b7..9265e446b2 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -143,7 +143,7 @@ AC_DEFUN([lgl_INIT],
gl_FUNC_UNGETC_WORKS
gt_TYPE_WCHAR_T
gt_TYPE_WINT_T
- AC_CHECK_FUNCS([shutdown])
+ AC_CHECK_FUNCS_ONCE([shutdown])
m4_ifval(lgltests_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([lgltests_LIBSOURCES_DIR])[ ||
for gl_file in ]lgltests_LIBSOURCES_LIST[ ; do
diff --git a/lib/gl/m4/sys_stat_h.m4 b/lib/gl/m4/sys_stat_h.m4
index d37fea827b..600489075a 100644
--- a/lib/gl/m4/sys_stat_h.m4
+++ b/lib/gl/m4/sys_stat_h.m4
@@ -1,4 +1,4 @@
-# sys_stat_h.m4 serial 17 -*- Autoconf -*-
+# sys_stat_h.m4 serial 18 -*- Autoconf -*-
dnl Copyright (C) 2006-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -41,6 +41,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
+ GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT])
GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT])
@@ -50,6 +51,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT])
HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT])
+ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
@@ -57,6 +59,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
+ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
diff --git a/lib/gl/sys_stat.in.h b/lib/gl/sys_stat.in.h
index 501a82c41b..298985baa2 100644
--- a/lib/gl/sys_stat.in.h
+++ b/lib/gl/sys_stat.in.h
@@ -38,6 +38,9 @@
/* Get nlink_t. */
#include <sys/types.h>
+/* Get struct timespec. */
+#include <time.h>
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
@@ -278,6 +281,12 @@
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
#endif
+/* Macros for futimens and utimensat. */
+#ifndef UTIME_NOW
+# define UTIME_NOW (-1)
+# define UTIME_OMIT (-2)
+#endif
+
#ifdef __cplusplus
extern "C" {
@@ -349,6 +358,23 @@ extern int fstatat (int fd, char const *name, struct stat *st, int flags);
#endif
+#if @GNULIB_FUTIMENS@
+# if @REPLACE_FUTIMENS@
+# undef futimens
+# define futimens rpl_futimens
+# endif
+# if !@HAVE_FUTIMENS@ || @REPLACE_FUTIMENS@
+extern int futimens (int fd, struct timespec const times[2]);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef futimens
+# define futimens(f,t) \
+ (GL_LINK_WARNING ("futimens is not portable - " \
+ "use gnulib module futimens for portability"), \
+ futimens (f, t))
+#endif
+
+
#if @GNULIB_MKDIRAT@
# if !@HAVE_MKDIRAT@
extern int mkdirat (int fd, char const *file, mode_t mode);
diff --git a/lib/gl/tests/test-sys_stat.c b/lib/gl/tests/test-sys_stat.c
index 4b5eb767b7..a73f9b81c6 100644
--- a/lib/gl/tests/test-sys_stat.c
+++ b/lib/gl/tests/test-sys_stat.c
@@ -1,5 +1,5 @@
/* Test of <sys/stat.h> substitute.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -253,9 +253,34 @@ verify (!S_ISWHT (S_IFLNK));
verify (!S_ISWHT (S_IFSOCK));
#endif
+/* POSIX 2008 requires traditional encoding of permission constants. */
+verify (S_IRWXU == 00700);
+verify (S_IRUSR == 00400);
+verify (S_IWUSR == 00200);
+verify (S_IXUSR == 00100);
+verify (S_IRWXG == 00070);
+verify (S_IRGRP == 00040);
+verify (S_IWGRP == 00020);
+verify (S_IXGRP == 00010);
+verify (S_IRWXO == 00007);
+verify (S_IROTH == 00004);
+verify (S_IWOTH == 00002);
+verify (S_IXOTH == 00001);
+verify (S_ISUID == 04000);
+verify (S_ISGID == 02000);
+verify (S_ISVTX == 01000);
+
+#if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000) \
+ || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000) \
+ || UTIME_NOW == UTIME_OMIT)
+invalid UTIME macros
+#endif
+
/* Check the existence of some types. */
nlink_t t1;
+struct timespec t2;
+
int
main ()
{
diff --git a/lib/gl/unistd.in.h b/lib/gl/unistd.in.h
index fd2747cb52..c7a0dc9a60 100644
--- a/lib/gl/unistd.in.h
+++ b/lib/gl/unistd.in.h
@@ -49,7 +49,7 @@
#endif
/* Get getopt(), optarg, optind, opterr, optopt. */
-#if @GNULIB_UNISTD_H_GETOPT@
+#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
# include <getopt.h>
#endif
@@ -239,7 +239,7 @@ extern char **environ;
#if @GNULIB_EUIDACCESS@
# if !@HAVE_EUIDACCESS@
-/* Like access(), except that is uses the effective user id and group id of
+/* Like access(), except that it uses the effective user id and group id of
the current process. */
extern int euidaccess (const char *filename, int mode);
# endif