Patch for building tz on HP-UX (FILENAME_MAX)

Hey, Tom, Tech Dev Tom.Hey at gb.vodafone.co.uk
Wed Apr 20 10:26:26 UTC 2005


Hello,

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 
output:

Diff'ed changes against: tzcode2005h.tar

	diff src_orig/Makefile src_patch/Makefile
	113a114,116
	> #  -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
	292a293,295
	>                 **
	>               ** TZ_FILENAME_MAX is either a #define for FILENAME_MAX or a
	>               ** user supplied value passed into the compiler's 
command line.
	294c297
	<               char            fullname[FILENAME_MAX + 1];
	---
	>               char            fullname[TZ_FILENAME_MAX + 1];
	diff src_orig/private.h src_patch/private.h
	310a311,314
	> #ifndef TZ_FILENAME_MAX
	> #define TZ_FILENAME_MAX FILENAME_MAX
	> #endif
	>
	diff src_orig/strftime.c src_patch/strftime.c
	657c657
	<       char                    filename[FILENAME_MAX];
	---
	>       char                    filename[TZ_FILENAME_MAX];

And finally how can I subscribe to this mailing list?

Regards,


Tom Hey

IPL Software Engineer
E-mail: Tom.Hey at mail.com






More information about the tz mailing list