[all-commits] [llvm/llvm-project] 75398f: [libc] Make time_t 64 bits long on all platforms b...

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Wed Sep 13 06:51:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 75398f28ebdb6008f028e413dffa4856a2523149
      https://github.com/llvm/llvm-project/commit/75398f28ebdb6008f028e413dffa4856a2523149
  Author: Mikhail R. Gadelha <mikhail at igalia.com>
  Date:   2023-09-13 (Wed, 13 Sep 2023)

  Changed paths:
    M libc/include/llvm-libc-types/time_t.h
    M libc/src/time/linux/clockGetTimeImpl.h
    M libc/src/time/linux/nanosleep.cpp

  Log Message:
  -----------
  [libc] Make time_t 64 bits long on all platforms but arm32

This patch changes the size of time_t to be an int64_t. This still
follows the POSIX standard which only requires time_t to be an integer.

Making time_t a 64-bit integer also fixes two cases in 32 bits platforms
that use SYS_clock_nanosleep_time64 and SYS_clock_gettime64, as the name
of these calls implies, they require a 64-bit time_t. For instance, in rv32,
the 32-bit version of these syscalls is not available.

We also follow glibc here, where time_t is still a 32-bit integer in
arm32.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159125




More information about the All-commits mailing list