This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bfd/vmsutil.c file timestamp calculations


> I can use the external symbols timezone and daylight instead of tm_gmtoff,
> if that's portable. ?Not sure what do do about the other followup patch to
> this file that removed st_mtim.tv_nsec. ?Is there a macro I can test or will
> I have to add some configure machinery? Looking for some advice here.

The st_mtim field in a struct timeval is a Sun extension, and is
available in newer versions of glibc if you define _BSD_SOURCE before
including <stat.h>. I think you'll need a configure test for it, and
fall back to setting the nanosecond component to 0 in its absence.

For tm_gmtoff in a struct tm, you can use a configure test for that,
too, but you also need to define _BSD_SOURCE to get it.

As far as I can tell, the timezone symbol should be portable (it's
listed as SVID 3 and POSIX); just call tzset() to initialize it if you
don't call some other time conversion function first. The daylight
symbol is obsolete, and it wouldn't tell you whether or not DST is in
effect anyway -- you'd need to call localtime() with your time_t value
and check tm_isdst.

Are you sure you need to correct for daylight saving time? What does
"local time" mean on VMS? Does it change when DST goes in and out of
effect? The timezone variable will give you the number of seconds west
of GMT for your standard timezone -- the same value whether DST is in
effect or not.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]