[Bug 13766] New: adjtimex: actually return the return value

bugzilla at busybox.net bugzilla at busybox.net
Thu Apr 22 12:21:54 UTC 2021


https://bugs.busybox.net/show_bug.cgi?id=13766

            Bug ID: 13766
           Summary: adjtimex: actually return the return value
           Product: Busybox
           Version: 1.33.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: martin.von.wittich at iserv.eu
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

adjtimex can be used to query if the system time is synchronized, e.g. whether
NTP is working or not. Example output of a machine where ntpd can't connect to
any peers (status: UNSYNC, return value: 5 (clock not synchronized)):

host ~ # busybox adjtimex; echo $?
    mode:         0
-o  offset:       0 us
-f  freq.adjust:  2126708 (65536 = 1ppm)
    maxerror:     16000000
    esterror:     16000000
    status:       16449 (PLL | UNSYNC)
-p  timeconstant: 7
    precision:    1 us
    tolerance:    32768000
-t  tick:         10000 us
    time.tv_sec:  1619093972
    time.tv_usec: 354882
    return value: 5 (clock not synchronized)
0

Unfortunately this has to be parsed from the output because the return value is
only printed and not actually returned. It would be useful if adjtimex had a
flag for this purpose, e.g. -r to actually return the call's return value. This
would allow scripts to use `adjtime -qr` to suppress the output and determine
the synchronization state efficiently by examining the return code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list