- New function time.tzset() provides access to the C library tzet()

function, if supported.  (SF patch #675422, by Stuart Bishop.)
This commit is contained in:
Guido van Rossum 2003-03-14 21:51:36 +00:00
parent 538f1d842c
commit d11b62edd0
7 changed files with 338 additions and 78 deletions

70
configure vendored
View file

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Revision: 1.391 .
# From configure.in Revision: 1.392 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
#
@ -16550,6 +16550,74 @@ _ACEOF
fi
# tzset(3) exists and works like we expect it to
echo "$as_me:$LINENO: checking for working tzset()" >&5
echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6
if test "${ac_cv_working_tzset+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_working_tzset=no
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <time.h>
int main()
{
int gmt_hour;
int eastern_hour;
time_t now;
now = time((time_t*)NULL);
putenv("TZ=GMT");
tzset();
gmt_hour = localtime(&now)->tm_hour;
putenv("TZ=US/Eastern");
tzset();
eastern_hour = localtime(&now)->tm_hour;
if (eastern_hour == gmt_hour)
exit(1);
exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_working_tzset=yes
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_working_tzset=no
fi
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5
echo "${ECHO_T}$ac_cv_working_tzset" >&6
if test "$ac_cv_working_tzset" = yes
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_WORKING_TZSET 1
_ACEOF
fi
# Look for subsecond timestamps in struct stat
echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5
echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6