SetSync sets clock status to TIME_OK
(clockid int32)
| 114 | |
| 115 | // SetSync sets clock status to TIME_OK |
| 116 | func SetSync(clockid int32) error { |
| 117 | tx := &unix.Timex{} |
| 118 | tx.Modes = AdjStatus | AdjMaxError |
| 119 | state, err := unix.ClockAdjtime(clockid, tx) |
| 120 | |
| 121 | if err == nil && state != unix.TIME_OK { |
| 122 | return fmt.Errorf("clock state %d is not TIME_OK after setting sync state", state) |
| 123 | } |
| 124 | return err |
| 125 | } |
no test coverage detected
searching dependent graphs…