/*
 * |-----------------------------------------------------------|
 * | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
 * | All Rights Reserved                                       |
 * |-----------------------------------------------------------|
 * |          Restricted Rights Legend                         |
 * | Use, duplication, or disclosure by the Government is      |
 * | subject to restrictions as set forth in                   |
 * | subparagraph (c)(1)(ii) of the Rights in Technical        |
 * | Data and Computer Software Clause of DFARS 252.227-7013.  |
 * |         MIPS Computer Systems, Inc.                       |
 * |         950 DeGuigne Avenue                               |
 * |         Sunnyvale, California 94088-3650, USA             |
 * |-----------------------------------------------------------|
 */
#ident	"$Header: settz.c,v 1.8.2.1 92/06/24 13:48:46 marker Exp $"
#include <sys/param.h>
#include <time.h>
#include <bsd43/sys/time.h>
#include <bsd43/sys/syscall.h>
#include <tzfile.h>

main()

{
	struct timeval tv;
	struct timezone tz;
#ifdef DEBUG 
	struct timezone debug_tz;
#endif
	struct tm *tp;
	static time_t clock_val;
	if (syscall(BSD43_SYS_gettimeofday,&tv, &tz)) {
		perror ("settz");
		exit (1);
	}
#ifdef DEBUG
	printf("tz.tz_minuteswest = %d\n", tz.tz_minuteswest);	
	printf("tz.tz_dsttime = %d\n", tz.tz_dsttime);	
#endif

	tp = localtime ((time_t *)&tv.tv_sec); 
	
	tz.tz_minuteswest = timezone/60;
	tz.tz_dsttime = daylight;
	if (syscall(BSD43_SYS_settimeofday ,(struct timeval *) NULL, &tz)) {
		perror ("settz");
		exit (2);
	}
#ifdef DEBUG
	if (syscall(BSD43_SYS_gettimeofday,&tv, &debug_tz)) {
		perror ("settz");
		exit (1);
	}
	printf("debug_tz.tz_minuteswest = %d\n", debug_tz.tz_minuteswest);	
	printf("debug_tz.tz_dsttime = %d\n", debug_tz.tz_dsttime);	
#endif /* DEBUG */
	exit (0);
}

