Re: [PATCH] delayacct: fix uapi timespec64 definition

From: wang.yaxin

Date: Mon Feb 02 2026 - 08:20:45 EST


>From: Arnd Bergmann <arnd@xxxxxxxx>

>

>The custom definition of 'struct timespec64' is incompatible with

>both the kernel's internal definition and the glibc type, at least

>on big-endian targets that have the tv_nsec field in a different

>place, and the definition clashes with any userspace that also

>defines a timespec64 structure.

>

>Running the header check with -Wpadding enabled produces this output

>that warns about the incorrect padding:

>

>usr/include/linux/taskstats.h:25:1: error: padding struct size to alignment boundary with 4 bytes >[-Werror=padded]

>

>Remove the hack and instead use the regular __kernel_timespec

>type that is meant to be used in uapi definitions.

>

>Fixes: 29b63f6eff0e ("delayacct: add timestamp of delay max")

>Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>


In uapi definition, __kernel_timespec is indeed a better solution compared to timespec64, as the former provides superior binary compatibility, nice job!


Thanks

Yaxin