1 /* $NetBSD: tzone.c,v 1.4 1998/03/14 04:39:55 lukem Exp $ */
5 __RCSID("$NetBSD: tzone.c,v 1.4 1998/03/14 04:39:55 lukem Exp $");
9 * tzone.c - get the timezone
11 * This is shared by bootpd and bootpef
14 #include <sys/types.h>
17 /* XXX - Is this really SunOS specific? -gwr */
18 /* This is in <time.h> but only visible if (__STDC__ == 1). */
22 # include <sys/time.h>
30 /* This is what other modules use. */
34 * Get our timezone offset so we can give it to clients if the
35 * configuration file doesn't specify one.
41 /* XXX - Is this really SunOS specific? -gwr */
42 secondswest
= timezone
;
44 struct timezone tzp
; /* Time zone offset for clients */
45 struct timeval tp
; /* Time (extra baggage) */
46 if (gettimeofday(&tp
, &tzp
) < 0) {
47 secondswest
= 0; /* Assume GMT for lack of anything better */
48 report(LOG_ERR
, "gettimeofday: %s", get_errmsg());
50 secondswest
= 60L * tzp
.tz_minuteswest
; /* Convert to seconds */