[Hamlib-developer] Year 2038 issues
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Nate B. <n0...@n0...> - 2024-01-19 18:35:20
|
Early this morning at 03:14:07 UTC the time remaining until the Unix Epoch rollover where the signed 32 bit count of seconds since 01 Jan 1970 00:00:00 UTC is just under 14 years. Certainly, that is a long time off, but, Hamlib is now 23 1/2 years old! I have not looked deeply, but it may be useful to ensure that Hamlib contains no problematic uses of time_t or anything that uses the 32 bit signed integer of the Unix epoch. I see the following: $ git grep time_t include/hamlib/rig.h:639:typedef float agc_time_t; include/hamlib/rig.h:2730: time_t twiddle_time; /*!< time when vfo twiddling was detected */ include/hamlib/rig.h:2926: time_t twiddle_time; /*!< time when vfo twiddling was detected */ lib/gettimeofday.c:23: time_t tm; lib/win32termios.h:70: time_t tv_sec; rigs/icom/icom.c:418:const agc_time_t agc_level[] = // default rigs/icom/icom.c:422:const agc_time_t agc_level2[] = // AM Mode for 7300/9700/705 rotators/satel/satel.c:102:// time_t time; security/AESStringCrypt.c:90: time_t current_time; security/security.c:36:static struct tm *gmtime_r(const time_t *t, struct tm *r) security/security.c:58: time_t t; src/microham.c:108:static time_t lastbeat = 0; src/microham.c:112:static time_t starttime; src/misc.c:2823:static struct tm *gmtime_r(const time_t *t, struct tm *r) src/misc.c:2846: time_t t; src/sleep.c:62: tv1.tv_sec = (time_t) delay; src/sleep.c:179: // Convert struct tm to time_t src/sleep.c:180: time_t start_seconds = mktime(&start); src/sleep.c:181: time_t end_seconds = mktime(&end); src/sleep.c:191: time_t rawtime; tests/rigmatrix.c:632: time_t gentime; tests/testsecurity.c:34:static struct tm *gmtime_r(const time_t *t, struct tm *r) tests/testsecurity.c:55: time_t t; Hopefully someone will jump at the chance to make sure that Hamlib will be y2k38 ready. 73, Nate -- "The optimist proclaims that we live in the best of all possible worlds. The pessimist fears this is true." Web: https://www.n0nb.us Projects: https://github.com/N0NB GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819 |