Re: [PATCH 00/25] Change time_t and clock_t to 64 bit

H. Peter Anvin
2014-05-16T23:12:23Z

On 05/15/2014 01:38 PM, Arnd Bergmann wrote:
>
> For practical purposes in the kernel, we may still want to use 64-bit
> nanoseconds: if we use a 96 bit struct timespec, that would be incompatible
> with the native type on 64-bit kernels, thus complicating the syscall
> emulation layer.
>
> I don't know why timespec on x32 uses 'long tv_nsec', it does seem
> problematic.

struct timespec is specified in POSIX as having type "long" for tv_nsec.
This, as Linus pointed out, is totally braindamaged.

x32 does not follow POSIX (Linus pretty much dictated that), and instead
does the __kernel_suseconds_t to match the native kernel type. The
proposal at some point was to try to push a snseconds_t into POSIX.

-hpa