Lines Matching +full:tv +full:- +full:set

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
34 * using zoneinfo rules or direct TZ environment variable set.
55 #define Unknown (-1)
73 struct timeval tv, *stv; in main() local
81 int initial_isdst = -1, final_isdst; in main()
86 while ((ch = getopt(argc, argv, "ais")) != -1) in main()
151 if (sysctlbyname("machdep.adjkerntz", &kern_offset, &len, NULL, 0) == -1) { in main()
159 if (gettimeofday(&tv, &tz)) { in main()
165 initial_sec = tv.tv_sec; in main()
176 if (localsec == -1) { in main()
197 offset = -local.tm_gmtoff; in main()
205 diff = offset - tz.tz_minuteswest * 60 - kern_offset; in main()
228 if (localsec == -1) { in main()
249 offset = -local.tm_gmtoff; in main()
257 diff = offset - tz.tz_minuteswest * 60 - kern_offset; in main()
267 stv = &tv; in main()
285 if (sysctlbyname("machdep.disable_rtc_set", &disrtcset, &len, NULL, 0) == -1) { in main()
292 if (sysctlbyname("machdep.disable_rtc_set", NULL, NULL, &disrtcset, len) == -1) { in main()
293 syslog(LOG_ERR, "sysctl(set: \"machdep.disable_rtc_set\"): %m"); in main()
310 (void)gettimeofday(&tv, NULL); in main()
311 tv.tv_sec += diff; in main()
312 stv = &tv; in main()
322 /* -- don't write RTC, else write RTC. */ in main()
327 if (sysctlbyname("machdep.adjkerntz", NULL, NULL, &kern_offset, len) == -1) { in main()
328 syslog(LOG_ERR, "sysctl(set: \"machdep.adjkerntz\"): %m"); in main()
334 if (sysctlbyname("machdep.wall_cmos_clock", NULL, NULL, &wall_clock, len) == -1) { in main()
335 syslog(LOG_ERR, "sysctl(set: \"machdep.wall_cmos_clock\"): %m"); in main()
343 if (sysctlbyname("machdep.disable_rtc_set", NULL, NULL, &disrtcset, len) == -1) { in main()
344 syslog(LOG_ERR, "sysctl(set: \"machdep.disable_rtc_set\"): %m"); in main()
353 /* wait for signals and acts like -a */ in main()
365 "usage: adjkerntz -i", in usage()
367 " adjkerntz -a [-s]", in usage()
368 "\t\t(adjustment call, -s for sleep/retry mode)"); in usage()