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

Alistair Francis alistair23 at gmail.com
Tue Mar 17 00:02:00 UTC 2020


On Sun, Mar 15, 2020 at 9:35 AM Dmitry V. Levin <ldv at altlinux.org> wrote:
>
> 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.
>
> Sorry, did you say that rv32 kernel can send SO_TIMESTAMP_OLD (and also
> SO_TIMESTAMPNS_OLD with SO_TIMESTAMPING_OLD) control messages containing
> 32-bit time_t, in contradiction with remaining rv32 types where time_t
> is 64-bit?

I think so.

>
> This would be so ridiculous for a new architecture that I cannot believe
> rv32 kernel behaves this way.

Why? There are still lots of syscalls that use a 32-bit time_t.

I sent a new patch series with a new version of this patch as well, so
you can see what I am doing there.

Alistair

>
>
> --
> ldv


More information about the Strace-devel mailing list