sysconf(_SC_TZNAME_MAX)

Thorsten Kukuk kukuk@suse.de
Tue Dec 18 22:55:00 GMT 2001


On Tue, Dec 18, Ulrich Drepper wrote:

> Thorsten Kukuk <kukuk@suse.de> writes:
> 
> > 2001-12-18  Thorsten Kukuk  <kukuk@suse.de>
> > 
> > 	* time/tzset.c(__tzname_max): Return at least _POSIX_TZNAME_MAX.
> 
> I think this rather belongs in sysconf.c.  Let's not mix the POSIX
> semantics of sysconf with the timezone implementation.

Ok, here is another patch:

2001-12-19  Thorsten Kukuk  <kukuk@suse.de>

        * sysdeps/posix/sysconf.c: Return at least _POSIX_TZNAME_MAX
	for _SC_TZNAME_MAX.

--- sysdeps/posix/sysconf.c
+++ sysdeps/posix/sysconf.c	2001/12/19 06:45:18
@@ -75,7 +75,14 @@
 #endif
 
     case _SC_TZNAME_MAX:
-      return __tzname_max ();
+      {
+         long int calc = __tzname_max ();
+
+         if (calc < _POSIX_TZNAME_MAX)
+           return _POSIX_TZNAME_MAX;
+         else
+           return calc;
+      }
 
     case _SC_JOB_CONTROL:
 #ifdef	_POSIX_JOB_CONTROL


-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH            Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B



More information about the Libc-hacker mailing list