[illumos-Developer] webrev: fix for 317 strptime needs %Z support

Garrett D'Amore garrett at damore.org
Fri Dec 3 20:32:01 PST 2010


http://mexico.purplecow.org/gdamore/webrev/strptime/

I would appreciate a timely review of this set of fixes for libc.

This includes adding proper support for parsing "foreign" timezone value
(with %z), and also adds support for %s in strftime and strptime, which
are supported on BSD and Linux.

As part of this, this also introduces timegm, which is also present on
the other non-Solaris FOSS'.  (It does so "safely", I believe, without
breaking compliance with any standards.)

Finally, while here, I have also cleaned up the code in strptime, using
NULL instead of 0, and removing pointless casts and pointless checks
against a terminating byte prior to calling ctype macros.  (These macros
properly handle the 0 byte -- treating it as a control character.)  The
net effect there ins improved readability of that code.

I have a test program that I used to test this code, that I'll be happy
to share on request.

Note that the addition of this functionality means that applications
that are compiled to use these functions or features may not work
properly on Solaris.  (This will not affect *illumos*'s ability to run
applications compiled on Solaris, of course.)

	- Garrett






More information about the Developer mailing list