Future directions

Gary E. Miller gem at rellim.com
Mon Sep 16 20:02:10 UTC 2019


Yo All!

Consider the a wishlist item as changes would be a bit jarring.

I'd like to see "struct shmTimme" cleaned up and move into a header file
for system use..  Right now it is not in any header file, so clients
like gpsd need their own copies.

Here is the current definition from attic/sht.c
 
struct shmTime {
        int    mode; /* 0 - if valid set
                      *       use values,
                      *       clear valid
                      * 1 - if valid set
                      *       if count before and after read of values is equal,
                      *         use values
                      *       clear valid
                      */
        volatile int    count;
        time_t          clockTimeStampSec;
        int             clockTimeStampUSec;
        time_t          receiveTimeStampSec;
        int             receiveTimeStampUSec;
        int             leap;
        int             precision;
        int             nsamples;
        volatile int    valid;
        unsigned        clockTimeStampNSec;     /* Unsigned ns timestamps */
        unsigned        receiveTimeStampNSec;   /* Unsigned ns timestamps */
};

And a slightly different one in ntpd/refclock_shm.c:

struct shmTime {
        int    mode; /* 0 - if valid is set:
                      *       use values,
                      *       clear valid
                      * 1 - if valid is set:
                      *       if count before and after read of values is equal,
                      *         use values
                      *       clear valid
                      */
        volatile int    count;
        time_t          clockTimeStampSec;
        int             clockTimeStampUSec;
        time_t          receiveTimeStampSec;
        int             receiveTimeStampUSec;
        int             leap;
        int             precision;
        int             nsamples;
        volatile int    valid;
        unsigned        clockTimeStampNSec;     /* Unsigned ns timestamps */
        unsigned        receiveTimeStampNSec;   /* Unsigned ns timestamps */
        int             dummy[8];
};

I assume the second one is the current one?

Not very useful on multi-lib (32 and 64-bit) hosts as int and unsigned
can be different sizes.

I'd also like to see use of some standard like timespec_t for the sec
and fractions.  Sadly this would be incompatible with current usage, so
a bit of a PITA to implement...

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20190916/61ec4987/attachment.bin>


More information about the devel mailing list