Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!hplabs!sri-unix!salkind@nyu
From: salkind%nyu@sri-unix.UUCP
Newsgroups: net.unix-wizards
Subject: Time zone is not set in settimeofday
Message-ID: <17418@sri-arpa.UUCP>
Date: Sat, 10-Mar-84 19:19:56 EST
Article-I.D.: sri-arpa.17418
Posted: Sat Mar 10 19:19:56 1984
Date-Received: Tue, 13-Mar-84 07:59:11 EST
Lines: 46

From:  Lou Salkind 

Subject: Time zone is not set in settimeofday
Index:	sys/sys/kern_time.c 4.2BSD

Description:
	The timezone field in the settimeofday system call is ignored.
	(I discovered this when I tried to change the PST timezone on our
	Pyramid system.)
Repeat-By:
	Run the program below and you will see no difference.
Fix:
	In kern_time.c:settimeofday(), just after the second
		if (u.u_error)
			return;
	add
		tz = atz;
	
	Also, the following program will allow you to change the timezone:

----- timezone.c -----
/*
 * timezone minuteswest [dsttime]
 */
#include 
#include 

struct	timeval tv;
struct	timezone tz;

main(argc, argv)
	int argc;
	char *argv[];
{
	if (argc < 2)
		exit(0);
	gettimeofday(&tv, &tz);
	tz.tz_minuteswest = atoi(argv[1]);
	if (argc > 2)
		tz.tz_dsttime = atoi(argv[2]);
	if (settimeofday(&tv, &tz) < 0) {
		perror("settimeofday");
		exit(1);
	}
	exit(0);
}