[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Tomi Ollila
On Mon, Nov 05 2012, Blake Jones wrote: >> Yet another idea for an alternative. Compile by entering 'sh xtimegm.c' >> and then run ./xtimegm >> >> Simple cases seems to work. Dst change may (or then may not) give one >> hour difference to the expected. The test "coverage" could be easily >> expan

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Tomi Ollila
On Sun, Nov 04 2012, Blake Jones wrote: > Hi Jani, > >> I'd prefer to use timegm() where available, and the suggested >> alternative [1] elsewhere. >> >> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html > > I considered this alternative, but decided against it because it's

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Blake Jones
>> The other approaches rely on letting libc do all the hard work of >> time zone manipulation, and then reading the tea leaves to find a way >> to undo it. > > Did you look at the gnu libc version -- I bet it is pretty hairy... I didn't look at either the GNU or the Solaris libc version. But th

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Blake Jones
>> The other approaches rely on letting libc do all the hard work of >> time zone manipulation, and then reading the tea leaves to find a way >> to undo it. > > Did you look at the gnu libc version -- I bet it is pretty hairy... I didn't look at either the GNU or the Solaris libc version. But th

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Tomi Ollila
On Mon, Nov 05 2012, Blake Jones wrote: >> Yet another idea for an alternative. Compile by entering 'sh xtimegm.c' >> and then run ./xtimegm >> >> Simple cases seems to work. Dst change may (or then may not) give one >> hour difference to the expected. The test "coverage" could be easily >> expan

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Blake Jones
> Yet another idea for an alternative. Compile by entering 'sh xtimegm.c' > and then run ./xtimegm > > Simple cases seems to work. Dst change may (or then may not) give one > hour difference to the expected. The test "coverage" could be easily > expanded to that ;) > > Hmm, I also found this: > h

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Blake Jones
> Yet another idea for an alternative. Compile by entering 'sh xtimegm.c' > and then run ./xtimegm > > Simple cases seems to work. Dst change may (or then may not) give one > hour difference to the expected. The test "coverage" could be easily > expanded to that ;) > > Hmm, I also found this: > h

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-05 Thread Tomi Ollila
On Sun, Nov 04 2012, Blake Jones wrote: > Hi Jani, > >> I'd prefer to use timegm() where available, and the suggested >> alternative [1] elsewhere. >> >> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html > > I considered this alternative, but decided against it because it's

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Jani Nikula
On Sun, 04 Nov 2012, Blake Jones wrote: > Hi Jani, > >> I'd prefer to use timegm() where available, and the suggested >> alternative [1] elsewhere. >> >> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html > > I considered this alternative, but decided against it because it's

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Blake Jones
> That is a valid point. Yet it doesn't change the fact that I'd prefer > to use timegm() where available. Internally, glibc uses the same code > to implement both timegm() and mktime(), and I'd hate it if the > results were subtly different depending on whether the time zone was > specified in the

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Blake Jones
> That is a valid point. Yet it doesn't change the fact that I'd prefer > to use timegm() where available. Internally, glibc uses the same code > to implement both timegm() and mktime(), and I'd hate it if the > results were subtly different depending on whether the time zone was > specified in the

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Blake Jones
Hi Jani, > I'd prefer to use timegm() where available, and the suggested > alternative [1] elsewhere. > > [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html I considered this alternative, but decided against it because it's completely MT-unsafe. I don't know whether libnotm

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Jani Nikula
On Sun, 04 Nov 2012, Blake Jones wrote: > Hi Jani, > >> I'd prefer to use timegm() where available, and the suggested >> alternative [1] elsewhere. >> >> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html > > I considered this alternative, but decided against it because it's

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Jani Nikula
On Nov 4, 2012 11:30 AM, "Blake Jones" wrote: > > The timegm(3) function is a non-standard extension to libc which is > available in GNU libc and on some BSDs. Although SunOS had this > function in its libc, Solaris (unfortunately) removed it. This patch > implements a very simple version of tim

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Blake Jones
Hi Jani, > I'd prefer to use timegm() where available, and the suggested > alternative [1] elsewhere. > > [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html I considered this alternative, but decided against it because it's completely MT-unsafe. I don't know whether libnotm

Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Jani Nikula
On Nov 4, 2012 11:30 AM, "Blake Jones" wrote: > > The timegm(3) function is a non-standard extension to libc which is > available in GNU libc and on some BSDs. Although SunOS had this > function in its libc, Solaris (unfortunately) removed it. This patch > implements a very simple version of tim

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-04 Thread Blake Jones
The timegm(3) function is a non-standard extension to libc which is available in GNU libc and on some BSDs. Although SunOS had this function in its libc, Solaris (unfortunately) removed it. This patch implements a very simple version of timegm() which is good enough for parse-time-string.c. Alth

[PATCH 10/10] timegm: add portable implementation (Solaris support)

2012-11-03 Thread Blake Jones
The timegm(3) function is a non-standard extension to libc which is available in GNU libc and on some BSDs. Although SunOS had this function in its libc, Solaris (unfortunately) removed it. This patch implements a very simple version of timegm() which is good enough for parse-time-string.c. Alth