Using clock_gettime(), fetch the realtime clock, which has as much as
nanosecond resolution. (In reality, it will likely ben more like
microseconds, though it returns the value in nanoseconds.) Use the
nanosecond value in SMLC log entries. On modern systems and over
ethernet links, second resolution is probably fairly coarse for trying
to debug RJE problems.
Weird gcc behavior. Code snippet:
uint16_t data;
char ch;
...
i = (data >> 8) & 0xff;
ch = data & 0xff;
...
fprintf(smlclog, "%s OTA '01%02o line '%02o set special character %d <%02x>\n", smlctimestamp, device, dc[dx].lineno, i, ch);
Output on x86-64 before this change:
17:13:51 OTA '0150 line '02 set special character 3 <ffffffff>
Output on armhf or on x86-64 after this change:
19:05:00.130466808 OTA '0150 line '02 set special character 3 <ff>
WTH? Masking an unsigned with an appropriately sized mask produces a
sign extension?
system to operate as a HASP station in an RJE environment. This implementation is
compatible with Bisync/HASP emulation in the Hercules IBM mainframe emulator and the
DtCyber CDC mainframe emulator.