diff options
author | Benjamin Holzman <bah@ecnvantage.com> | 2006-07-19 03:11:09 -0400 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2006-11-06 09:43:30 +0000 |
commit | 8572b25d870f5a82a300ce816436b52f0f8afb0a (patch) | |
tree | 5b8af110b4d2e7e843e45f9f5b7e771b039847fe /Configure | |
parent | 296c5fee961dc8807527de4ac3a8363d8cea1a10 (diff) | |
download | perl-8572b25d870f5a82a300ce816436b52f0f8afb0a.tar.gz |
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
From: "Benjamin Holzman" <bholzman@longitude.com>
Message-ID: <010801c6ab24$09b9ed30$ce0515ac@office.iseoptions.com>
p4raw-id: //depot/perl@29209
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 57 |
1 files changed, 56 insertions, 1 deletions
@@ -26,7 +26,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Mon Oct 23 17:35:45 CEST 2006 [metaconfig 3.0 PL70] +# Generated on Mon Nov 6 10:30:43 CET 2006 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <<EOF @@ -549,6 +549,7 @@ d_ldbl_dig='' d_libm_lib_version='' d_link='' d_localtime_r='' +d_localtime_r_needs_tzset='' localtime_r_proto='' d_locconv='' d_lockf='' @@ -14514,6 +14515,59 @@ case "$d_localtime_r" in ;; esac +: see if localtime_r calls tzset +case "$localtime_r_proto" in +REENTRANT_PROTO*) + $cat >try.c <<EOCP +/* Does our libc's localtime_r call tzset ? + * return 0 if so, 1 otherwise. + */ +#include <sys/types.h> +#include <unistd.h> +#include <time.h> +#include <string.h> +#include <malloc.h> +int main() +{ + time_t t = time(0L); + char w_tz[]="TZ" "=GMT+5", + e_tz[]="TZ" "=GMT-5", + *tz_e = (char*)malloc(16), + *tz_w = (char*)malloc(16); + struct tm tm_e, tm_w; + memset(&tm_e,'\0',sizeof(struct tm)); + memset(&tm_w,'\0',sizeof(struct tm)); + strcpy(tz_e,e_tz); + strcpy(tz_w,w_tz); + + putenv(tz_e); + localtime_r(&t, &tm_e); + + putenv(tz_w); + localtime_r(&t, &tm_w); + + if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) + return 1; + return 0; +} +EOCP + set try + if eval $compile; then + if ./try; then + d_localtime_r_needs_tzset=undef; + else + d_localtime_r_needs_tzset=define; + fi; + else + d_localtime_r_needs_tzset=undef; + fi; + ;; + *) + d_localtime_r_needs_tzset=undef; + ;; +esac +$rm -f try try.* core + : see if localeconv exists set localeconv d_locconv eval $inlibc @@ -21505,6 +21559,7 @@ d_ldbl_dig='$d_ldbl_dig' d_libm_lib_version='$d_libm_lib_version' d_link='$d_link' d_localtime_r='$d_localtime_r' +d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset' d_locconv='$d_locconv' d_lockf='$d_lockf' d_longdbl='$d_longdbl' |