[PATCH v3 3/4] tests/sockopt-timestamp: Don't test old timestamps if unsupported

Dmitry V. Levin ldv at altlinux.org
Sat Mar 7 14:05:46 UTC 2020


On Fri, Mar 06, 2020 at 06:22:22PM -0800, Alistair Francis wrote:
> On new 32-bit architectures (like RV32) the kernel defines SO_TIMESTAMP
> to SO_TIMESTAMP_NEW (see include/uapi/asm-generic/socket.h:133).
> Although SO_TIMESTAMP_OLD still exists it returns data that doesn't fit
> into the struct timeval as the old timestamp isn't 64-bit (y2038 safe).
> 
> To fix this let's skip the test cases if SO_TIMESTAMP is the same as
> SO_TIMESTAMP_NEW. Unfortunately as SO_TIMESTAMP is defined with a one
> line if statement (? :) we can't use preprocess defines and instead need
> to just skipt the tests.

If SO_TIMESTAMP_OLD still exists and the kernel can send it,
then its decoding should be tested.

If struct timeval is not a correct type, the test should use
an appropriate type (kernel_old_timeval?) instead.


-- 
ldv


More information about the Strace-devel mailing list