1
0
mirror of https://github.com/PDP-10/its.git synced 2026-04-19 01:18:29 +00:00

Updated netime and times to handle daily savings time.

This commit is contained in:
Eric Swenson
2023-09-24 12:58:57 -07:00
committed by Lars Brinkhoff
parent 41bf05dc87
commit f945bff100
2 changed files with 103 additions and 18 deletions

58
src/sysen1/netime.127 → src/sysen1/netime.128 Executable file → Normal file
View File

@@ -139,6 +139,26 @@ hosts:
[asciz "EMACK-AND-BOLIOS"]
nhosts==:.-hosts
DEFINE TZONE STD,DST
[ASCIZ /STD/],,[ASCIZ /DST/]
TERMIN
repeat 12.-2,TZONE ;Dunno -3..-12
tzone EET,EEST ;-2
tzone CET,CEST ;-1
tznam: TZONE GMT,BST ; 0 How to ask for British Summer Time??
TZONE ; 1
TZONE ; 2
TZONE ; 3 (NST = Newfoundland is -0330)
TZONE AST,ADT ; 4 Atlantic
TZONE EST,EDT ; 5 Eastern
TZONE CST,CDT ; 6 Central
TZONE MST,MDT ; 7 Mountain
TZONE PST,PDT ; 8 Pacific
TZONE YST,YDT ; 9 Yukon
TZONE HST,HDT ; 10 Alaska-Hawaii
TZONE BST,BDT ; 11 Bering
REPEAT 24.-11.,TZONE ; 12-24 unspecified
;;; Parameters that can be patched:
@@ -150,7 +170,7 @@ wait: 20.*60. ; Wait 20 seconds polling other hosts.
numerq: 2 ; Ceiling of 2/3 of the hosts that respond
denomq: 3 ; must agree on the time.
minq: 4 ; Insist on at least 4 hosts with times in
minq: 3 ; Insist on at least 3 hosts with times in
; agreement.
spread: 400. ; Times agree if they differ by less than
@@ -160,6 +180,9 @@ days: 3 ; If machine looks like it was down for
; this many days, then require a human to
; set the time.
tzhdif: 0 ; time zone difference in hours
tzsdif: 0 ; time zone difference in seconds
filesn: sixbit /DRAGON/ ; The creation date of this file is some
filen1: sixbit /DRAGON/ ; indication of what time the system last
filen2: sixbit /HOARD/ ; thought it was.
@@ -227,6 +250,14 @@ irps sym,,[ka10p,kl10p,ks10p,pdtime,fyear]
.lose
movem tt,sym
termin
move tt,[squoze 0,tzone]
.eval tt,
jrst [movei tt,s%est
jrst .+2]
movem tt,tzhdif
imuli tt,60.*60.
movem tt,tzsdif
move tt,[squoze 0,ksfreq]
.eval tt,
movei tt,<<1000._12.>+30.>/60.
@@ -239,13 +270,14 @@ termin
setzm times+0
move tt,[times+0,,times+1]
blt tt,times+nhosts-1
movei a,%corfc
dpb a,[$cpkop opkt]
movei a,%corfc ; request for connection
dpb a,[$cpkop opkt] ; chaosnet operation
movei a,4
dpb a,[$cpknb opkt]
dpb a,[$cpknb opkt] ; number of bytes
move a,[.byte 8 ? "T ? "I ? "M ? "E]
movem a,opkt+%cpkdt
movem a,opkt+%cpkdt ; packet data
setzm count
hrloi c,-1-nhosts ; C: aobjn into hosts
loop: tlnn netmsk\%ftime
.hang
@@ -464,7 +496,7 @@ gotime: movem a,lowest
imul c,[s%y]
add b,c ; B: Seconds from 1/1/00 to this year.
move a,time
subi a,s%est ; GMT -> EST
sub a,tzsdif
sub a,b
imuli a,60.
movem a,ticks
@@ -487,7 +519,7 @@ notks: move a,clktim
skipe ka10p
.lose
doit: sub a,ticks ; A: offset for loading into PDTIME
format "~&Setting the time to be ~Q ~S ~
format "~&Setting the time to be ~Q ~A ~
(supplied by ~A).~&",[qtime,qzone,host]
move tt,fyear
hrli tt,year
@@ -591,14 +623,18 @@ tablex: format "~&Low=~D High=~D Median=~D",[lowest,highest,median]
;;; A (arg): network time
;;; A (val): disk format date
;;; E (val): SIXBIT of timezone
cvtime: subi a,s%est ; GMT -> EST
cvtime: sub a,tzsdif ; GMT -> local time zone
call datime"sectim ; -> disk format date
save b
save c
movei b,60.*60.
move c,tzhdif ; get time zone diff in hours
call datime"odayl
skipa e,[sixbit /EDT/]
skipa e,[sixbit /EST/]
call datime"timadd
jrst [hrrz e,tznam(c) ; get DST TZ name
call datime"timadd ; account for DST
jrst .+2]
hlrz e,tznam(c) ; get standard TZ name
rest c
rest b
return