Patch for building tz on HP-UX (FILENAME_MAX)

Hey, Tom, Tech Dev Tom.Hey at
Wed Apr 20 10:26:26 UTC 2005


First let me say thanks, tz appears to be an incredibly useful library.

However after building on HP-UX (details below) I ran into a problem 
with the definition of FILENAME_MAX. As HP-UX still supports some of 
its older filesystems the longest guaranteed FILENAME is 14 
characters. This gives a FILENAME_MAX value that is too short to 
access most of the timezone location files.

	OS: HP-UX 11
	cpp.ansi: HP92453-01 B.11.11.06 HP C Preprocessor (ANSI)
	ccom: HP92453-01 B.11.11.04 HP C Compiler
	/usr/ccs/bin/ld: 92453-07 linker linker ld B.11.30 011005

Patching tz, to optionally build with longer filename support can be 
done in any number of ways. One such change to support a new Makefile 
option "TZ_FILENAME_MAX" is described in the following patch/diff 

Diff'ed changes against: tzcode2005h.tar

	diff src_orig/Makefile src_patch/Makefile
	> #  -DTZ_FILENAME_MAX=1024 if you want to specify the maximum 
supported filename
	> #       length; default from compiler's FILENAME_MAX. FILENAME_MAX
	> #       maybe too small on some systems (HP-UX)
	diff src_orig/localtime.c src_patch/localtime.c
	>                 **
	>               ** TZ_FILENAME_MAX is either a #define for FILENAME_MAX or a
	>               ** user supplied value passed into the compiler's 
command line.
	<               char            fullname[FILENAME_MAX + 1];
	>               char            fullname[TZ_FILENAME_MAX + 1];
	diff src_orig/private.h src_patch/private.h
	> #ifndef TZ_FILENAME_MAX
	> #endif
	diff src_orig/strftime.c src_patch/strftime.c
	<       char                    filename[FILENAME_MAX];
	>       char                    filename[TZ_FILENAME_MAX];

And finally how can I subscribe to this mailing list?


Tom Hey

IPL Software Engineer
E-mail: Tom.Hey at

More information about the tz mailing list