/*1* tzone.c - get the timezone2*3* This is shared by bootpd and bootpef4*/56#ifdef SVR47/* XXX - Is this really SunOS specific? -gwr */8/* This is in <time.h> but only visible if (__STDC__ == 1). */9extern long timezone;10#else /* SVR4 */11/* BSD or SunOS */12# include <time.h>13# include <syslog.h>14#endif /* SVR4 */1516#include "bptypes.h"17#include "report.h"18#include "tzone.h"1920/* This is what other modules use. */21int32 secondswest;2223/*24* Get our timezone offset so we can give it to clients if the25* configuration file doesn't specify one.26*/27void28tzone_init()29{30#ifdef SVR431/* XXX - Is this really SunOS specific? -gwr */32secondswest = timezone;33#else /* SVR4 */34struct tm *tm;35time_t now;3637(void)time(&now);38if ((tm = localtime(&now)) == NULL) {39secondswest = 0; /* Assume GMT for lack of anything better */40report(LOG_ERR, "localtime() failed");41} else {42secondswest = -tm->tm_gmtoff;43}44#endif /* SVR4 */45}464748