httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lekha Menon" <lekha.me...@patni.com>
Subject Re: Problem with apr_time_exp_lt (localtime_r) on AIX
Date Wed, 01 Mar 2006 08:17:55 GMT
Sorry.The test program worked fine. However, call to API  apr_time_exp_lt ()
fails. It returns  year1  with 2147483647000000.
When iput is 2147000000000000, it returns year as 138. My local time zone
setting is PAKST (GMT +5).

Is this causing the problem?

Thanks & Regards,
Lekha Menon
Extn - 5329


----- Original Message -----
  From: Bennett, Tony - CNF
  To: dev@httpd.apache.org
  Sent: Tuesday, February 28, 2006 9:51 PM
  Subject: RE: Problem with apr_time_exp_lt (localtime_r) on AIX


  Lekha,

  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.

  #ifdef _THREAD_SAFE
  #include <pthread.h>
  #endif

  #include <stdio.h>
  #include <time.h>

  main()
  {
      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);

      #else

      my_localtime = localtime(&my_time);
      #endif

      printf("my_localtime->tm_year=%hd\n", my_localtime->tm_year);
  }





----------------------------------------------------------------------------
--
  From: Lekha Menon [mailto:lekha.menon@patni.com]
  Sent: Tuesday, February 28, 2006 4:57 AM
  To: dev@httpd.apache.org
  Subject: Problem with apr_time_exp_lt (localtime_r) on AIX


  Hi,

  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
explode_time().

  Here, localtime_r is called with arguments (&tt, &tm) where tt=2147483647.

  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!

  Regards,
  Lekha


  http://www.patni.com
  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 netadmin@patni.com and
delete this mail.
  _____________________________________________________________________

http://www.patni.com
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 netadmin@patni.com and delete this mail. 
_____________________________________________________________________

Mime
View raw message