[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] access to Solaris2.5 system? [Re: strftime merge from Emacs

From: Jim Meyering
Subject: [Bug-gnulib] access to Solaris2.5 system? [Re: strftime merge from Emacs
Date: Fri, 06 Jun 2003 16:30:45 +0200

Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> At worst, (assuming this is solaris-specific) change this code
>> to be used only on __sun__ systems.
> I'm a bit leery of that, as I suspect that the bug came from SVR4.
>> At best, someone will write an autoconf-run-test to detect the
>> real problem.  Does anyone have details of how tzset misbehaves?
> The bug is that you can't do something like this:
>   tm = localtime (&t);
>   tzset ();
>   year = tm->tm_year; etc.
> because tzset modifies *tm.

Thanks, Paul.

Can anyone here compile/run the following program to see if it
exits nonzero on a Solaris 2.5 system?  Technically, such a test
will have to have the canonical code testing macros like

gcc tz-bug.c
./a.out || echo failed-$TZ
env TZ=utc ./a.out || echo failed-$TZ

E.g., save the file below as tz-bug.c
and run the above commands.

#include <time.h>
#include <string.h>
#include <stdlib.h>
main ()
  time_t t;
  struct tm *tm;
  struct tm tm_copy;

  time (&t);
  tm = localtime (&t);
  tm_copy = *tm;
  tzset ();
  exit (memcmp (tm, &tm_copy, sizeof *tm) ? 1 : 0);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]