Change max error and max estimate type to signed long #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The adjtimex system call returns type long (implied signed) for maxerror and esterror values.
See:
The expectation and casting to unsigned long results in UB when running ntptime. The below segments are output from ntptime run 3 times on the same host within ~10 seconds. Note the variance between "maximum error" and "estimated error" values of each run.
ntp_gettime() returns code 0 (OK) time dfd7f65c.52672fbc Wed, Jan 2 2019 21:47:56.321, (.321887282), maximum error 496 us, estimated error 18446744073709551612 us, TAI offset 37 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 0.000 us, frequency 7.972 ppm, interval 1 s, maximum error 496 us, estimated error 18446744073709551612 us, status 0x2001 (PLL,NANO), time constant 6, precision 0.001 us, tolerance 500 ppm,ntp_gettime() returns code 0 (OK) time dfd7f66a.e34a1274 Wed, Jan 2 2019 21:48:10.887, (.887849349), maximum error 18446744073709551615 us, estimated error 18446744073709551615 us, TAI offset 37 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 0.000 us, frequency 7.668 ppm, interval 1 s, maximum error 18446744073709551615 us, estimated error 18446744073709551615 us, status 0x2001 (PLL,NANO), time constant 6, precision 0.001 us, tolerance 500 ppm,ntp_gettime() returns code 0 (OK) time dfd7f678.9e5f0f5c Wed, Jan 2 2019 21:48:24.618, (.618638187), maximum error 504 us, estimated error 4 us, TAI offset 37 ntp_adjtime() returns code 0 (OK) modes 0x0 (), offset 0.000 us, frequency 7.028 ppm, interval 1 s, maximum error 504 us, estimated error 4 us, status 0x2001 (PLL,NANO), time constant 6, precision 0.001 us, tolerance 500 ppm,