On Wed, Oct 19, 2022 at 05:22:33PM -0700, Jacob Keller wrote:
> 
> 
> On 10/18/2022 8:08 AM, Maciek Machnikowski wrote:
> > Current implementation of generic pps source relies on the UTC-TAI offset 
> > read
> > from system. Some OSes don't set that offset by default and return 0. In 
> > such
> > case ts2phc sets PHC time to UTC timescale without notifying user.
> > 
> 
> Not sure what "Some OSes" means here.. The 3rd patch spells it out that
> TAI offset is not set unless an NTP daemon has set it.

I initially found this issue on the RPi OS and reproduced on Fedora and RHEL 
after
issuing:
# timedatectl set-ntp false
and rebooting the system.

Here's the simple code to test it:
#include <stdio.h>
#include <stdlib.h>
#include <sys/timex.h>
#include <string.h>

int get_tai(void)
{
        struct timex ntx;

        memset(&ntx, 0, sizeof(ntx));

        adjtimex(&ntx);
        return ntx.tai;
}

int main(int argc, char **argv)
{
        int i, tai;
        tai = get_tai();
        printf("TAI-UTC offset: %i\n", tai);

        return 0;
}

Regards
Maciek


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to