#if 0 taken from a google search, see this url (concatenate it): http://groups.google.com/groups?q=cmos+rtc+ntp+freebsd &hl=en&lr=&ie=UTF-8&oe=UTF-8 &selm=20020717.105424.74756579.yoshiaki%40kt.rim.or.jp&rnum=7 #endif #include #include main() { int i; struct timeval clocktime; printf("getting system time...\n"); i = gettimeofday(&clocktime,NULL); if (i == -1) { fprintf(stderr,"gettimeofday failed.\n\r"); perror("gettimeofday"); } printf("setting hw clock...\n"); i = settimeofday(&clocktime,NULL); if (i == -1) { fprintf(stderr,"settimeofday failed.\n\r"); perror("settimeofday"); } printf("Done!\n"); }