How big is time_t? Alignment?
Hal Murray
hmurray at megapathdsl.net
Sat May 14 03:18:23 UTC 2016
fallenpegasus at gmail.com said:
> I recommend the following paranoia checking regarding the shm buffer: - do
> not use time_t or ints directly, but cast to the "Exact width" integer types
> defined in stdint.h
> see https://en.wikipedia.org/wiki/C_data_types#Fixed-width_integer_types -
> add an 8 byte endian check array, cast from a int of that size, and write in
> an int of the value 0x0102030405060708 or similar, to check endianness
That would make sense if we were starting from scratch.
The current status is that NTP Classic, NTPsec, and gpsd all use the same
text to define the struct used in shared memory. I don't think we should
rock that boat. This is by definition the way to do it, whatever the memory
layout turns out to be.
--
These are my opinions. I hate spam.
More information about the devel
mailing list