From e4d101c4e770b7c10f2c3672b93a7815d24e0144 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 1 May 2017 16:10:46 +0200 Subject: [PATCH] New module 'localtime-buffer', split off from module 'gettimeofday'. * lib/localtime-buffer.h: New file. * lib/localtime-buffer.c: New file, extracted from lib/gettimeofday.c. * lib/time.in.h (tzset): New declaration. (localtime, gmtime): Don't test GNULIB_GETTIMEOFDAY. * lib/tzset.c: New file, extracted from lib/gettimeofday.c. * lib/gettimeofday.c: Include localtime-buffer.h. Remove code that was moved to lib/localtime-buffer.c or lib/tzset.c. * m4/localtime-buffer.m4: New file. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. * m4/tzset.m4 (gl_FUNC_TZSET): Move code from m4/gettimeofday.m4 to here, with modifications. Set HAVE_TZSET, REPLACE_TZSET. Invoke gl_LOCALTIME_BUFFER_NEEDED. (gl_FUNC_TZSET_CLOBBER): Don't require gl_HEADER_SYS_TIME_H; not needed since 2007-01-18. * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Remove code that deals with tzset. (gl_FUNC_GETTIMEOFDAY_CLOBBER): Require gl_LOCALTIME_BUFFER_DEFAULTS. Invoke gl_LOCALTIME_BUFFER_NEEDED instead of gl_GETTIMEOFDAY_REPLACE_LOCALTIME. (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Remove macro. * modules/localtime-buffer: New file. * modules/time (Depends-on): Remove 'gettimeofday'. (Makefile.am): Substitute GNULIB_TZSET, HAVE_TZSET, REPLACE_TZSET. Don't substitute GNULIB_GETTIMEOFDAY. * modules/tzset (Description): Enable hyperlink to POSIX spec. (Files): Add lib/tzset.c. (Depends-on): Remove gettimeofday. Add localtime-buffer, time. (configure.ac): Arrange to conditionally compile lib/tzset.c. Invoke gl_TIME_MODULE_INDICATOR. * modules/gettimeofday (Depends-on): Add localtime-buffer. --- ChangeLog | 35 +++++++++++++++++++ lib/gettimeofday.c | 73 ++++------------------------------------ lib/localtime-buffer.c | 58 +++++++++++++++++++++++++++++++ lib/localtime-buffer.h | 27 +++++++++++++++ lib/localtime.c | 2 +- lib/time.in.h | 22 ++++++++++-- lib/tzset.c | 48 ++++++++++++++++++++++++++ m4/gettimeofday.m4 | 21 ++---------- m4/localtime-buffer.m4 | 21 ++++++++++++ m4/time_h.m4 | 3 ++ m4/tzset.m4 | 26 +++++++++++--- modules/gettimeofday | 1 + modules/localtime-buffer | 25 ++++++++++++++ modules/time | 5 +-- modules/tzset | 10 ++++-- 15 files changed, 280 insertions(+), 97 deletions(-) create mode 100644 lib/localtime-buffer.c create mode 100644 lib/localtime-buffer.h create mode 100644 lib/tzset.c create mode 100644 m4/localtime-buffer.m4 create mode 100644 modules/localtime-buffer diff --git a/ChangeLog b/ChangeLog index 2712adde26..c87285ed09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2017-05-01 Bruno Haible + + New module 'localtime-buffer', split off from module 'gettimeofday'. + * lib/localtime-buffer.h: New file. + * lib/localtime-buffer.c: New file, extracted from lib/gettimeofday.c. + * lib/time.in.h (tzset): New declaration. + (localtime, gmtime): Don't test GNULIB_GETTIMEOFDAY. + * lib/tzset.c: New file, extracted from lib/gettimeofday.c. + * lib/gettimeofday.c: Include localtime-buffer.h. Remove code that was + moved to lib/localtime-buffer.c or lib/tzset.c. + * m4/localtime-buffer.m4: New file. + * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Initialize GNULIB_TZSET, + HAVE_TZSET, REPLACE_TZSET. + * m4/tzset.m4 (gl_FUNC_TZSET): Move code from m4/gettimeofday.m4 to + here, with modifications. Set HAVE_TZSET, REPLACE_TZSET. Invoke + gl_LOCALTIME_BUFFER_NEEDED. + (gl_FUNC_TZSET_CLOBBER): Don't require gl_HEADER_SYS_TIME_H; not needed + since 2007-01-18. + * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Remove code that deals with + tzset. + (gl_FUNC_GETTIMEOFDAY_CLOBBER): Require gl_LOCALTIME_BUFFER_DEFAULTS. + Invoke gl_LOCALTIME_BUFFER_NEEDED instead of + gl_GETTIMEOFDAY_REPLACE_LOCALTIME. + (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Remove macro. + * modules/localtime-buffer: New file. + * modules/time (Depends-on): Remove 'gettimeofday'. + (Makefile.am): Substitute GNULIB_TZSET, HAVE_TZSET, + REPLACE_TZSET. Don't substitute GNULIB_GETTIMEOFDAY. + * modules/tzset (Description): Enable hyperlink to POSIX spec. + (Files): Add lib/tzset.c. + (Depends-on): Remove gettimeofday. Add localtime-buffer, time. + (configure.ac): Arrange to conditionally compile lib/tzset.c. Invoke + gl_TIME_MODULE_INDICATOR. + * modules/gettimeofday (Depends-on): Add localtime-buffer. + 2017-05-01 Bruno Haible copy-file: Preserve sub-second time stamps. diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index a4a71a7481..0d64885026 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -29,72 +29,7 @@ # include #endif -#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME - -/* Work around the bug in some systems whereby gettimeofday clobbers - the static buffer that localtime uses for its return value. The - gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has - this problem. The tzset replacement is necessary for at least - Solaris 2.5, 2.5.1, and 2.6. */ - -static struct tm tm_zero_buffer; -static struct tm *localtime_buffer_addr = &tm_zero_buffer; - -# undef localtime -extern struct tm *localtime (time_t const *); - -# undef gmtime -extern struct tm *gmtime (time_t const *); - -/* This is a wrapper for localtime. It is used only on systems for which - gettimeofday clobbers the static buffer used for localtime's result. - - On the first call, record the address of the static buffer that - localtime uses for its result. */ - -struct tm * -rpl_localtime (time_t const *timep) -{ - struct tm *tm = localtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -/* Same as above, since gmtime and localtime use the same buffer. */ -struct tm * -rpl_gmtime (time_t const *timep) -{ - struct tm *tm = gmtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ - -#if TZSET_CLOBBERS_LOCALTIME - -# undef tzset -extern void tzset (void); - -/* This is a wrapper for tzset, for systems on which tzset may clobber - the static buffer used for localtime's result. */ -void -rpl_tzset (void) -{ - /* Save and restore the contents of the buffer used for localtime's - result around the call to tzset. */ - struct tm save = *localtime_buffer_addr; - tzset (); - *localtime_buffer_addr = save; -} - -#endif +#include "localtime-buffer.h" #ifdef WINDOWS_NATIVE @@ -119,7 +54,11 @@ initialize (void) /* This is a wrapper for gettimeofday. It is used only on systems that lack this function, or whose implementation of this function - causes problems. */ + causes problems. + Work around the bug in some systems whereby gettimeofday clobbers + the static buffer that localtime uses for its return value. The + gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has + this problem. */ int gettimeofday (struct timeval *restrict tv, void *restrict tz) diff --git a/lib/localtime-buffer.c b/lib/localtime-buffer.c new file mode 100644 index 0000000000..7620b30e7c --- /dev/null +++ b/lib/localtime-buffer.c @@ -0,0 +1,58 @@ +/* Provide access to the last buffer returned by localtime() or gmtime(). + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 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 + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +/* written by Jim Meyering */ + +#include + +/* Specification. */ +#include "localtime-buffer.h" + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +static struct tm tm_zero_buffer; +struct tm *localtime_buffer_addr = &tm_zero_buffer; + +/* This is a wrapper for localtime. + + On the first call, record the address of the static buffer that + localtime uses for its result. */ + +struct tm * +rpl_localtime (time_t const *timep) +{ + struct tm *tm = localtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +/* Same as above, since gmtime and localtime use the same buffer. */ +struct tm * +rpl_gmtime (time_t const *timep) +{ + struct tm *tm = gmtime (timep); + + if (localtime_buffer_addr == &tm_zero_buffer) + localtime_buffer_addr = tm; + + return tm; +} + +#endif diff --git a/lib/localtime-buffer.h b/lib/localtime-buffer.h new file mode 100644 index 0000000000..cd958dee4c --- /dev/null +++ b/lib/localtime-buffer.h @@ -0,0 +1,27 @@ +/* Provide access to the last buffer returned by localtime() or gmtime(). + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 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 + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +/* written by Jim Meyering */ + +#include + +#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME + +/* The address of the last buffer returned by localtime() or gmtime(). */ +extern struct tm *localtime_buffer_addr; + +#endif diff --git a/lib/localtime.c b/lib/localtime.c index 07b532aec9..5316930b67 100644 --- a/lib/localtime.c +++ b/lib/localtime.c @@ -19,7 +19,7 @@ /* Specification. */ #include -/* Keep consistent with gettimeofday.c! */ +/* Keep consistent with localtime-buffer.c! */ #if !(GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME) # include diff --git a/lib/time.in.h b/lib/time.in.h index 8f748ecdda..52467004c6 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -120,6 +120,24 @@ _GL_CXXALIAS_SYS (nanosleep, int, _GL_CXXALIASWARN (nanosleep); # endif +/* Initialize time conversion information. */ +# if @GNULIB_TZSET@ +# if @REPLACE_TZSET@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset rpl_tzset +# endif +_GL_FUNCDECL_RPL (tzset, void, (void)); +_GL_CXXALIAS_RPL (tzset, void, (void)); +# else +# if ! @HAVE_TZSET@ +_GL_FUNCDECL_SYS (tzset, void, (void)); +# endif +_GL_CXXALIAS_SYS (tzset, void, (void)); +# endif +_GL_CXXALIASWARN (tzset); +# endif + /* Return the 'time_t' representation of TP and normalize TP. */ # if @GNULIB_MKTIME@ # if @REPLACE_MKTIME@ @@ -187,7 +205,7 @@ _GL_CXXALIASWARN (gmtime_r); /* Convert TIMER to RESULT, assuming local time and UTC respectively. See and . */ -# if @GNULIB_LOCALTIME@ || @GNULIB_GETTIMEOFDAY@ +# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@ # if @REPLACE_LOCALTIME@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef localtime @@ -202,7 +220,7 @@ _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); _GL_CXXALIASWARN (localtime); # endif -# if @GNULIB_GETTIMEOFDAY@ +# if 0 || @REPLACE_GMTIME@ # if @REPLACE_GMTIME@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef gmtime diff --git a/lib/tzset.c b/lib/tzset.c new file mode 100644 index 0000000000..1cb9822146 --- /dev/null +++ b/lib/tzset.c @@ -0,0 +1,48 @@ +/* Provide tzset for systems that don't have it or for which it's broken. + + Copyright (C) 2001-2003, 2005-2007, 2009-2017 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 + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +/* written by Jim Meyering */ + +#include + +/* Specification. */ +#include + +#include "localtime-buffer.h" + +/* This is a wrapper for tzset, for systems on which tzset may clobber + the static buffer used for localtime's result. + Work around the bug in some systems whereby tzset clobbers the + static buffer that localtime uses for its return value. The + tzset function from Solaris 2.5, 2.5.1, and 2.6 has this problem. */ + +void +tzset (void) +#undef tzset +{ +#if TZSET_CLOBBERS_LOCALTIME + /* Save and restore the contents of the buffer used for localtime's + result around the call to tzset. */ + struct tm save = *localtime_buffer_addr; +#endif + + tzset (); + +#if TZSET_CLOBBERS_LOCALTIME + *localtime_buffer_addr = save; +#endif +} diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 742b6c9e10..34adc64778 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -54,19 +54,6 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); if test $REPLACE_STRUCT_TIMEVAL = 1; then REPLACE_GETTIMEOFDAY=1 fi - m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ - gl_FUNC_TZSET_CLOBBER - case "$gl_cv_func_tzset_clobber" in - *yes) - REPLACE_GETTIMEOFDAY=1 - gl_GETTIMEOFDAY_REPLACE_LOCALTIME - AC_DEFINE([tzset], [rpl_tzset], - [Define to rpl_tzset if the wrapper function should be used.]) - AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], - [Define if tzset clobbers localtime's static buffer.]) - ;; - esac - ]) fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], [Define this to 'void' or 'struct timezone' to match the system's @@ -85,6 +72,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], [ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], [gl_cv_func_gettimeofday_clobber], @@ -119,17 +107,12 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], case "$gl_cv_func_gettimeofday_clobber" in *yes) REPLACE_GETTIMEOFDAY=1 - gl_GETTIMEOFDAY_REPLACE_LOCALTIME AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) + gl_LOCALTIME_BUFFER_NEEDED ;; esac ]) -AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - REPLACE_GMTIME=1 - REPLACE_LOCALTIME=1 -]) - # Prerequisites of lib/gettimeofday.c. AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:]) diff --git a/m4/localtime-buffer.m4 b/m4/localtime-buffer.m4 new file mode 100644 index 0000000000..3965b5d9f2 --- /dev/null +++ b/m4/localtime-buffer.m4 @@ -0,0 +1,21 @@ +# localtime-buffer.m4 serial 1 +dnl Copyright (C) 2017 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. + +AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], +[ + NEED_LOCALTIME_BUFFER=0 +]) + +dnl Macro invoked from other modules, to signal that the compilation of +dnl module 'localtime-buffer' is needed. +AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], +[ + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + NEED_LOCALTIME_BUFFER=1 + REPLACE_GMTIME=1 + REPLACE_LOCALTIME=1 +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 index e0f663ec71..f52b60192e 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -113,11 +113,13 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) + GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) + HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) dnl If another module says to replace or to not replace, do that. dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; dnl this lets maintainers check for portability. @@ -127,6 +129,7 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME]) REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET]) dnl Hack so that the time module doesn't depend on the sys_time module. dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. diff --git a/m4/tzset.m4 b/m4/tzset.m4 index e9e543cbaf..20939e9b6a 100644 --- a/m4/tzset.m4 +++ b/m4/tzset.m4 @@ -1,4 +1,4 @@ -# serial 7 +# serial 8 # Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -13,13 +13,31 @@ # Written by Paul Eggert and Jim Meyering. -# A placeholder to ensure that this m4 file gets included by aclocal. -AC_DEFUN([gl_FUNC_TZSET], []) +AC_DEFUN([gl_FUNC_TZSET], +[ + AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([tzset]) + if test $ac_cv_func_tzset = no; then + HAVE_TZSET=0 + fi + gl_FUNC_TZSET_CLOBBER + case "$gl_cv_func_tzset_clobber" in + *yes) + REPLACE_TZSET=1 + AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], + [Define if tzset clobbers localtime's static buffer.]) + gl_LOCALTIME_BUFFER_NEEDED + ;; + *) + REPLACE_TZSET=0 + ;; + esac +]) # Set gl_cv_func_tzset_clobber. AC_DEFUN([gl_FUNC_TZSET_CLOBBER], [ - AC_REQUIRE([gl_HEADER_SYS_TIME_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether tzset clobbers localtime buffer], gl_cv_func_tzset_clobber, diff --git a/modules/gettimeofday b/modules/gettimeofday index b4bdcc37c7..106e7a7765 100644 --- a/modules/gettimeofday +++ b/modules/gettimeofday @@ -7,6 +7,7 @@ m4/gettimeofday.m4 Depends-on: sys_time +localtime-buffer [test $NEED_LOCALTIME_BUFFER = 1] configure.ac: gl_FUNC_GETTIMEOFDAY diff --git a/modules/localtime-buffer b/modules/localtime-buffer new file mode 100644 index 0000000000..e511d437b3 --- /dev/null +++ b/modules/localtime-buffer @@ -0,0 +1,25 @@ +Description: +Access to the internal buffer of the localtime() function and the gmtime() function. + +Files: +lib/localtime-buffer.h +lib/localtime-buffer.c +m4/localtime-buffer.m4 + +Depends-on: +time [false] + +configure.ac: +AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) +AC_LIBOBJ([localtime-buffer]) + +Makefile.am: + +Include: +"localtime-buffer.h" + +License: +LGPLv2+ + +Maintainer: +all diff --git a/modules/time b/modules/time index 5cb8ac2c52..c235ac8dd0 100644 --- a/modules/time +++ b/modules/time @@ -7,7 +7,6 @@ m4/time_h.m4 Depends-on: extensions -gettimeofday include_next snippet/arg-nonnull snippet/c++defs @@ -31,7 +30,6 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ -e 's/@''GNULIB_CTIME''@/$(GNULIB_CTIME)/g' \ - -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -e 's/@''GNULIB_LOCALTIME''@/$(GNULIB_LOCALTIME)/g' \ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ @@ -40,11 +38,13 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ + -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ + -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ @@ -53,6 +53,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $( -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ diff --git a/modules/tzset b/modules/tzset index 8fa9ee6408..5f036b07a6 100644 --- a/modules/tzset +++ b/modules/tzset @@ -1,14 +1,20 @@ Description: -tzset - initialize time conversion information +tzset() function: initialize time conversion information. Files: +lib/tzset.c m4/tzset.m4 Depends-on: -gettimeofday +time +localtime-buffer [test $NEED_LOCALTIME_BUFFER = 1] configure.ac: gl_FUNC_TZSET +if test $HAVE_TZSET = 0 || test $REPLACE_TZSET = 1; then + AC_LIBOBJ([tzset]) +fi +gl_TIME_MODULE_INDICATOR([tzset]) Makefile.am: -- 2.39.5