httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bennett, Tony - CNF" <>
Subject RE: Problem with apr_time_exp_lt (localtime_r) on AIX
Date Tue, 28 Feb 2006 16:21:17 GMT
I wrote the sample program below, and ran it on both AIX 4.3.3 & AIX 5.1
in both threaded and unthreaded mode (xlc vs. xlc_r compiler).
In both cases it returned 138.
#include <pthread.h>
#include <stdio.h>
#include <time.h>
    struct tm  wk_localtime;
    struct tm *my_localtime;
    time_t  my_time = 2147483647;
    #ifdef _THREAD_SAFE
    memset(&wk_localtime, '\0', sizeof(wk_localtime));
    my_localtime = localtime_r(&my_time, &wk_localtime);
    my_localtime = localtime(&my_time);
    printf("my_localtime->tm_year=%hd\n", my_localtime->tm_year);



From: Lekha Menon [] 
Sent: Tuesday, February 28, 2006 4:57 AM
Subject: Problem with apr_time_exp_lt (localtime_r) on AIX

I am facing a strange problem with apr_time_exp_lt.
On AIX, when i call apr_time_exp_lt with 2nd arg as 2147483647000000LL,
it sets the yr as 1 instead on 138. 
The same works on Linux properly.
I investigated the code & found that apr_time_exp_lt internally calls
Here, localtime_r is called with arguments (&tt, &tm) where
localtime_r seems to be having some issue!
For checking localtime_r, i wrote a sample program. There also, while
passing tt=2147483647, it returned  1 instead of 138.
Is this AIX specific?
Please help!
Thanks in adv!
World-Wide Partnerships. World-Class Solutions. 

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to whom
this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at and delete this mail. 

View raw message