"Fossies" - the Fresh Open Source Software Archive

Member "PPSkit-2.1.7/patch-ntp-4.0" (21 Mar 2003, 2807 Bytes) of package /linux/misc/old/PPSkit-2.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 : NOTE: ntp-4.1.1 should work right out of the box (does not need a patch)!
    2 : However I suggested those goodies to the NTP folks. Maybe those are in the
    3 : current development version.
    4 Index: ntpd/ntp_control.c
    5 ===================================================================
    6 RCS file: /usr/src/packages/SOURCES/PkgSrcRep/xntp/ntpd/ntp_control.c,v
    7 retrieving revision 1.1.1.11
    8 diff -u -r1.1.1.11 ntp_control.c
    9 --- ntpd/ntp_control.c	8 Mar 2002 20:13:48 -0000	1.1.1.11
   10 +++ ntpd/ntp_control.c	20 Apr 2002 20:45:10 -0000
   11 @@ -1251,6 +1251,7 @@
   12  		    sizeof(str_system) - 1);
   13  #else
   14  		(void)strcpy(str, utsnamebuf.sysname);
   15 +		(void)strcat(str, "-");
   16  		(void)strcat(str, utsnamebuf.release);
   17  		ctl_putstr(sys_var[CS_SYSTEM].text, str, strlen(str));
   18  #endif /* HAVE_UNAME */
   19 Index: util/ntptime.c
   20 ===================================================================
   21 RCS file: /usr/src/packages/SOURCES/PkgSrcRep/xntp/util/ntptime.c,v
   22 retrieving revision 1.1.1.10
   23 diff -u -r1.1.1.10 ntptime.c
   24 --- util/ntptime.c	25 Jul 2001 17:48:52 -0000	1.1.1.10
   25 +++ util/ntptime.c	20 Apr 2002 22:03:54 -0000
   26 @@ -36,10 +36,9 @@
   27  #define tv_frac_sec tv_usec
   28  #endif
   29  
   30 -
   31  #define TIMEX_MOD_BITS \
   32 -"\20\1OFFSET\2FREQUENCY\3MAXERROR\4ESTERROR\5STATUS\6TIMECONST\
   33 -\13PLL\14FLL\15MICRO\16NANO\17CLKB\20CLKA"
   34 +"\20\1OFFSET\2FREQUENCY\3MAXERROR\4ESTERROR\5STATUS\6TIMECONST\7PPSMAX\
   35 +\10TAI\13PLL\14FLL\15MICRO\16NANO\17CLKB\20CLKA"
   36   
   37  #define TIMEX_STA_BITS \
   38  "\20\1PLL\2PPSFREQ\3PPSTIME\4FLL\5INS\6DEL\7UNSYNC\10FREQHOLD\
   39 @@ -68,7 +67,7 @@
   40  static volatile int status;	/* most recent status bits */
   41  static volatile int flash;	/* most recent ntp_adjtime() bits */
   42  char* progname;
   43 -static char optargs[] = "MNT:cde:f:hm:o:rs:t:";
   44 +static char optargs[] = "MNT:cde:f:hm:o:p:rs:t:";
   45  
   46  int
   47  main(
   48 @@ -140,6 +139,12 @@
   49  		ntx.modes |= MOD_OFFSET;
   50  		ntx.offset = atoi(ntp_optarg);
   51  		break;
   52 +#ifdef MOD_PPSMAX
   53 +	    case 'p':
   54 +		ntx.modes |= MOD_PPSMAX;
   55 +		ntx.shift = atoi(ntp_optarg);
   56 +		break;
   57 +#endif
   58  	    case 'r':
   59  		rawtime++;
   60  		break;
   61 @@ -165,8 +170,9 @@
   62  -h		display this help info\n\
   63  -m maxerror	max possible error (us)\n\
   64  -o offset	current offset (ms)\n\
   65 +%s\
   66  -r		print the unix and NTP time raw\n\
   67 --l leap		Set the leap bits\n\
   68 +-s status	set status bits\n\
   69  -t timeconstant	log2 of PLL time constant (0 .. %d)\n",
   70  			       progname, optargs,
   71  #ifdef MOD_MICRO
   72 @@ -188,6 +194,11 @@
   73  #else
   74  "",
   75  #endif
   76 +#ifdef MOD_PPSMAX
   77 +"-p limit	set maximum PPS averaging interval to 2^limit\n",
   78 +#else
   79 +"",
   80 +#endif
   81  			       MAXTC);
   82  		exit(2);
   83  	}
   84 @@ -305,7 +316,7 @@
   85  		    (int) ntv.time.tv_sec, fdigits, (int) time_frac,
   86  		    ctime((const time_t *) &ntv.time.tv_sec));
   87  #if NTP_API > 3
   88 -		printf(", TAI offset %d\n", ntv.tai);
   89 +		printf(", TAI offset %ld\n", ntv.tai);
   90  #else
   91  		printf("\n");
   92  #endif /* NTP_API */