Overview
| Artifact ID: | 12571b8a6b590123e58a1c62a9134d95454e5774 |
|---|---|
| Ticket: | 1113146fffffffffffffffffffffffffffffffff
clock-34.6 clock scan failure in NetBSD |
| User & Date: | georgeps on 2005-02-01 07:04:46 |
Changes
- closedate changed to: "2005-02-01T00:04:46"
- closer changed to: "georgeps"
- icomment:
Logged In: YES user_id=585068 With the help of KBK we discovered that it's really the problem that I don't have an /etc/localtime symlink on my system. The NetBSD installer creates this symlink, and the manual page for afterboot mentions it at the top. I removed the symlink, because the clock is skewed in NetBSD (from the BIOS and Windows). The fix in my case is: # ln -s /usr/share/zoneinfo/US/Mountain /etc/localtime There is an RTC_OFFSET kernel option for NetBSD that should in theory fix this problem, and allow me to have the same time for all operating systems, and the BIOS. I wrote this test program to verify: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <time.h> int main () { struct tm t; t.tm_sec = 0; t.tm_min = 0; t.tm_hour = 14; t.tm_mday = 22; t.tm_mon = 9; t.tm_year = 2; t.tm_wday = 6; t.tm_yday = 297; if (-1 == mktime (&t)) { printf ("errno %d\n", errno); perror ("mktime"); return EXIT_FAILURE; } return EXIT_SUCCESS; } Without /etc/localtime: $ cc mktime_test.c && ./a.out errno 2 mktime: No such file or directory - login: "georgeps"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "georgeps"