delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/03/05/10:43:55

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=lU+D1TLhvoWE+meJNo2pt+JHPLaDI4o8mNNcyY+BlYKljWMGp+vCk
Dl+qHRvh+qaQUQ6nnZH7sTQaoev5uCEbLNrVHa5hXKbEGvAZQG8HAQkNW4nWVnzY
CEt8naoUd1t0gop2JXhyaAxeibJ8Qdqs9cPWGdHD7+IpwFDrO8KVWQ=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=PG0tdW7bAoJaiyaRkUE90PLCmiQ=; b=Nywkq0NRV0cXZkyO1PfW7YLi2DKt
745w1lW/fBgK4fh1Zmc5Ur2I/u9Avf358GC1F5mnZmU6vncZ/sAPZe4hPU+pVLoE
lrgIQ/yi5yok0QHUFsEzgNHkIpMo1A1Otey/Uwji+1mZlFhen38EfGapWGzkbJWX
rjS7q2ktquNQSWw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Wed, 5 Mar 2014 16:43:36 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: struct tm problem
Message-ID: <20140305154336.GA2856@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAJoYywWqyBYEJKriugeU0deHm=DsS_LYgHotaX6K=q6TO_tmQQ AT mail DOT gmail DOT com> <20140304081928 DOT GF7236 AT calimero DOT vinschen DOT de> <CAJoYywUF2gpX5+-9H3gExyRMYUtJQyi_mHOX42uG9kRfaQ0Nvg AT mail DOT gmail DOT com> <20140305113524 DOT GB2192 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20140305113524.GB2192@calimero.vinschen.de>
User-Agent: Mutt/1.5.21 (2010-09-15)

--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mar  5 12:35, Corinna Vinschen wrote:
> On Mar  5 11:45, Irfan Adilovic wrote:
> > On Tue, Mar 4, 2014 at 9:19 AM, Corinna Vinschen wrote:
> > > On Mar  3 23:28, Irfan Adilovic wrote:
> > >> > tm_gmtoff is not required by the standard:
> > >> > http://www.opengroup.org/onlinepubs/009695399/basedefs/time.h.html
> > >> >
> > >> > However, it is an extension available in the Olson tzcode, which
> > >> > cygwin seems to use.  Enabling it would seem to be a matter of
> > >> > setting -DTM_GMTOFF=3Dtm_gmtoff and adding it to time.h.
> > >
> > > And same for TM_ZONE.
> > >
> > >> I have successfully done this and use the tm_gmtoff in my code
> > >> actively. Is there a reason this isn't enabled? Is there any interest
> > >> in the community to make tm_gmtoff available by default (It's so eas=
y,
> > >> it's a shame it's not :-))?
> > >
> > > It's easy to change the struct, but changing the size of a structure
> > > is an incompatible change to existing applications which leads to
> > > overwriting memory.
> > >
> > > A change to Cygwin involves an extra check if the application has been
> > > build against an older or a newer version of Cygwin, and to fill the
> > > tm_gmtoff/tm_zone structure members dependent on that.  So it's not j=
ust
> > > done by defining TM_GMTOFF and TM_ZONE.
> >=20
> > Now that you mention the incompatibility, it seems logical -- the size
> > of the struct is hard-coded when allocation frames in the executable
> > (or when mallocing), and passing that to the library will write
> > tm_gmtoff past the allocated area -- but how can one even try to
> > recognize and act upon that at runtime, without recompiling the
> > executable?
>=20
> The Cygwin DLL can check under which version of the Cygwin DLL an
> executable has been compiled.  We're using this knowledge already in
> other circumstances.  If the DLL finds it has been compiled under an old
> Cygwin version which doesn't know these new members, it will not try to
> read or write these members, if it's an executabled compiled under a
> newer DLL which knows these members, it will utilize them.  If you're
> running a new executable under an old version of the DLL, the members
> will probably contain garbage, but that's an unsupported scenario
> anyway.

I created new snapshots on http://cygwin.com/snapshots/ which provide
tm_gmtoff and tm_zone for executables linked against that version of
the DLL.  Please note that it's *not* sufficient to install the new DLL
for this functionality to get.  You *must* install the full snapshot,
including libs and header files.

Please give this a thorough test.


Thanks,
Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--ZPt4rx8FFjLCG7dd
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTF0YoAAoJEPU2Bp2uRE+g0FAP/R7rW40iyYJiabuuDmqJ3fcU
m84IVem5RQ3mzlpRiz6XiijOnAeqxlx6239MC8imi0Hnv6KNQXsibHVXzZH8kSGF
pgAMk5XtYfVKbdbU/qAJf8gP5JVo2CjTQiGS+EqwDfrJZ7medyNTOaz2TR6ifNpO
upObUuUQB3s50r5XZ9Dh3FgaGAmHh5sivClrFtJU4IaezX6aOKHi6zQRw5/u3++m
Wcqp+xOvMPr6+sT/5uENYysS8ROTO3wIEAIk5NCE9tKnpGUHEvp6UQKSQMjIvyvK
D/u71MWOaxwhKi83iD5yfwGaWt8a9uxa3URf04QPkFgtSEqq6wsfYHSkSHEFuCs/
KVm78Lfdg8Gyrmpcp6cE3fft6RGSs1i8uF7cWxUwJ61giO7rfDps9sxi77nQNwIx
uZrB60ANFrcF2gFg8v+fRy7PmYMdrugMGXaN7+lv1fWOESluBi0Z5+zCHoTg5TZt
H94diXBqtmZ9suEcDyP9aQQTYwndIBMYGCUNkT4DZlPmMsK8pDewBXrrcDNtNvjo
OUEHsWILIztxYHbIQX+khDxL5yI3v92Bq7aYm/K2CF3BA5tvEWSLGw2aYm7Mkl0q
aIp7X46aRiROGg3jmEE5nx7PDSUNawcMkVsZJjPywQ7lxCWWie8mTtfADfctjwD7
LbG+8M7S84gPlVKDh2kL
=Gqzo
-----END PGP SIGNATURE-----

--ZPt4rx8FFjLCG7dd--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019