/* This program reads the WWV clock and corrects the system clock based on the WWV clock. It will wake up once an hour in order to check the clock. If the clock has lost sync, it aborts. Planned improvement: if timesync has been lost, it will call the NIST or Nautical Observatory phone line to check the time. 1999_11_22 Eliminated CTS10 related code to transport to Linux. */ #include #include #include #include #include main() { int i,j; char c,str[100]; system("date -u\n"); printf("\n Is this time correct within one minute (y/n)?"); if ('n' == getc(stdin)) { printf("Please set the system clock using the command\n"); printf("date -u mmddhhmmyy.ss\n"); printf("and run clock again.\n"); exit(1); }; getc(stdin); /* Catch the CR */ printf("\n Synchronizing system clock from PSTI (rack) Clock\n"); printf(" The task number is "); fflush(stdout); system("ptsisync &"); printf("\n\n"); /* logf( "clock" ); */ exit(0); }