[all-commits] [llvm/llvm-project] 123bf0: [libc] Unify gettime implementations (#65383)

Mikhail R. Gadelha via All-commits all-commits at lists.llvm.org
Fri Sep 8 09:41:42 PDT 2023


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

  Changed paths:
    M libc/src/time/CMakeLists.txt
    R libc/src/time/clock_gettime.cpp
    R libc/src/time/gettimeofday.cpp
    M libc/src/time/linux/CMakeLists.txt
    M libc/src/time/linux/clock.cpp
    A libc/src/time/linux/clockGetTimeImpl.h
    A libc/src/time/linux/clock_gettime.cpp
    A libc/src/time/linux/gettimeofday.cpp
    M libc/src/time/linux/time.cpp

  Log Message:
  -----------
  [libc] Unify gettime implementations (#65383)

Similar to D159208, this patch unifies the calls to a syscall, in this
patch it is the syscall SYS_clock_gettime/SYS_clock_gettime64.

This patch also fixes calls to SYS_clock_gettime64 by creating a
timespec64 object, passing it to the syscall and rewriting the timespec
given by the caller with timespec64 object's contents. This fixes cases
where timespec has a 4 bytes long time_t member, but SYS_clock_gettime
is not available (e.g., rv32).




More information about the All-commits mailing list