[PATCH v2] linux: Use 'long int' for timespec tv_nsec on x32 (BZ #16437)

Florian Weimer fweimer@redhat.com
Fri Dec 10 15:44:46 GMT 2021


* H. J. Lu via Libc-alpha:

> On Fri, Dec 10, 2021 at 3:03 AM Adhemerval Zanella via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>>
>> Although the kernel ABI uses 64-bit (so it can re-use the syscall
>> logic from x86_64), POSIX states the type to be 'long int'.  It
>> requires to explicit signal extend the value on syscalls that
>> take the value to avoid requiring bumping the minimum kernel version
>> (ea2ce8f3514e ("time: Fix get_timespec64() for y2038 safe compat
>> interfaces") got merged into v4.18, futex and recvmsg followed in v5.1,
>> but v5.6 is considered 'complete').
>>
>> The fix uses 'long long int' array to represent 'struct timespec',
>> since it allows a simpler code than define a kernel specific timespec.
>>
>> There is no need to compat symbol, the now high-bits are not used
>> to represent the nanoseconds and for some syscalls it only issues
>> an error (which hardly indicates the need of compat symbol).
>>
>> Checked on x86_64-linux-gnu-x32 with kernel 4.4.0 and 5.13.
>
> Isn't it an ABI change for x32?

I agree.  I said so repeatedly.

Thanks,
Florian



More information about the Libc-alpha mailing list