Timezone stuff and System V Verification Suite

Arthur David Olson ado
Fri Aug 7 14:56:01 UTC 1987


The problem at hand:  the mod.sources version of the time zone compiler sets
tzname[1] to "EWT" for the Eastern US; this causes problems with SVVS.

I had a realization this morning.  A while back I added a "-s" flag to the
time zone compiler to let folks produce time zone information files with
whose time(2) values were limited to numbers that have the same value whether
you take them to be signed or unsigned.  This was done to let time zone files
be used in network setups where some machines on the network wanted to have
signed time_t's and others wanted to have unsigned time_t's.

Providentially, if you use the -s option you should get files that let localtime
be SVVS compliant.  Not only is this in line with kre's suggestion that the
work should be done in the compiler rather than in localtime--it's already in
place.

I've attached diffs for zic.c and zic.8; apologies to those who've seen them
before (but note that I've added a new note about SVVS to zic.8).

				--ado

-------------------------------------------------------------------------------

*** 3.1/zic.c	Fri Aug  7 10:42:22 1987
--- 3.6/zic.c	Fri Aug  7 10:42:39 1987
***************
*** 4,10 ****
  
  #ifndef lint
  #ifndef NOID
! static char	sccsid[] = "@(#)zic.c	3.1";
  #endif /* !NOID */
  #endif /* !lint */
  
--- 4,10 ----
  
  #ifndef lint
  #ifndef NOID
! static char	sccsid[] = "@(#)zic.c	3.6";
  #endif /* !NOID */
  #endif /* !lint */
  
***************
*** 355,361 ****
  usage()
  {
  	(void) fprintf(stderr,
! "%s: usage is %s [ -v ] [ -l localtime ] [ -d directory ] [ filename ... ]\n",
  		progname, progname);
  	exit(1);
  }
--- 355,361 ----
  usage()
  {
  	(void) fprintf(stderr,
! "%s: usage is %s [ -s ] [ -v ] [ -l localtime ] [ -d directory ] [ filename ... ]\n",
  		progname, progname);
  	exit(1);
  }
***************
*** 362,367 ****
--- 362,368 ----
  
  static char *	lcltime = NULL;
  static char *	directory = NULL;
+ static int	sflag = FALSE;
  
  main(argc, argv)
  int	argc;
***************
*** 374,380 ****
  	umask(umask(022) | 022);
  #endif
  	progname = argv[0];
! 	while ((c = getopt(argc, argv, "d:l:v")) != EOF)
  		switch (c) {
  			default:
  				usage();
--- 375,381 ----
  	umask(umask(022) | 022);
  #endif
  	progname = argv[0];
! 	while ((c = getopt(argc, argv, "d:l:vs")) != EOF)
  		switch (c) {
  			default:
  				usage();
***************
*** 401,406 ****
--- 402,410 ----
  			case 'v':
  				noise = TRUE;
  				break;
+ 			case 's':
+ 				sflag = TRUE;
+ 				break;
  		}
  	if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
  		usage();	/* usage message by request */
***************
*** 465,470 ****
--- 469,476 ----
  		tt_signed = FALSE;
  		min_time = 0;
  		max_time = ~(time_t) 0;
+ 		if (sflag)
+ 			max_time >>= 1;
  	} else {
  		tt_signed = TRUE;
  		min_time = bit;
***************
*** 471,476 ****
--- 477,484 ----
  		max_time = bit;
  		++max_time;
  		max_time = -max_time;
+ 		if (sflag)
+ 			min_time = 0;
  	}
  	min_year = TM_YEAR_BASE + gmtime(&min_time)->tm_year;
  	max_year = TM_YEAR_BASE + gmtime(&max_time)->tm_year;
***************
*** 687,693 ****
  inrule(fields, nfields)
  register char **	fields;
  {
! 	struct rule	r;
  
  	if (nfields != RULE_FIELDS) {
  		error("wrong number of fields on Rule line");
--- 695,701 ----
  inrule(fields, nfields)
  register char **	fields;
  {
! 	static struct rule	r;
  
  	if (nfields != RULE_FIELDS) {
  		error("wrong number of fields on Rule line");
***************
*** 757,763 ****
  register char **	fields;
  {
  	register char *	cp;
! 	struct zone	z;
  	register int	i_gmtoff, i_rule, i_format;
  	register int	i_untilyear, i_untilmonth;
  	register int	i_untilday, i_untiltime;
--- 765,771 ----
  register char **	fields;
  {
  	register char *	cp;
! 	static struct zone	z;
  	register int	i_gmtoff, i_rule, i_format;
  	register int	i_untilyear, i_untilmonth;
  	register int	i_untilday, i_untiltime;

-------------------------------------------------------------------------------

*** 3.1/zic.8	Fri Aug  7 10:41:29 1987
--- 3.4/zic.8	Fri Aug  7 10:41:32 1987
***************
*** 12,17 ****
--- 12,19 ----
  .B \-l
  .I localtime
  ] [
+ .B \-s
+ ] [
  .I filename
  \&... ]
  .SH DESCRIPTION
***************
*** 43,48 ****
--- 45,55 ----
  of years representable by
  .IR time (2)
  values.
+ .TP
+ .B \-s
+ Limit time values stored in output files to values that are the same
+ whether they're taken to be signed or unsigned.
+ You can use this option to generate SVVS-compatible files.
  .sp
  Input lines are made up of fields.
  Fields are separated from one another by any number of white space characters.
***************
*** 98,104 ****
  field.
  .TP
  .B TYPE
! Gives the type of year in which the year applies.
  If
  .B TYPE
  is
--- 105,111 ----
  field.
  .TP
  .B TYPE
! Gives the type of year in which the rule applies.
  If
  .B TYPE
  is
***************
*** 155,161 ****
  field.
  .TP
  .B AT
! Gives the time of day at which the rule takes affect.
  Recognized forms include:
  .nf
  .in +.5i
--- 162,168 ----
  field.
  .TP
  .B AT
! Gives the time of day at which the rule takes effect.
  Recognized forms include:
  .nf
  .in +.5i
***************
*** 291,294 ****
  /etc/zoneinfo	standard directory used for created files
  .SH "SEE ALSO"
  newctime(3), tzfile(5), zdump(8)
! .. @(#)zic.8	3.1
--- 298,301 ----
  /etc/zoneinfo	standard directory used for created files
  .SH "SEE ALSO"
  newctime(3), tzfile(5), zdump(8)
! .. @(#)zic.8	3.4



More information about the tz mailing list