[all-commits] [llvm/llvm-project] cb2d2a: [SystemZ][ZOS] Provide CLOCK_MONOTONIC alternative

zibi2 via All-commits all-commits at lists.llvm.org
Fri Feb 12 10:40:52 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb2d2ae56ae3f0554c40c2d7f231ca5058e4d50c
      https://github.com/llvm/llvm-project/commit/cb2d2ae56ae3f0554c40c2d7f231ca5058e4d50c
  Author: Zbigniew Sarbinowski <zibi at ca.ibm.com>
  Date:   2021-02-12 (Fri, 12 Feb 2021)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    A libcxx/include/__support/ibm/gettod_zos.h
    M libcxx/src/chrono.cpp

  Log Message:
  -----------
  [SystemZ][ZOS] Provide CLOCK_MONOTONIC alternative

We need CLOCK_MONOTONIC equivalent implementation for z/OS within libc++. The default implementation is asserting.

On z/OS the lack of  'clock_gettime()' and 'time_point()' force us to look for alternatives.
The current proposal is to use `gettimeofday()` for CLOCK_MONOTONIC  which is also used in CLOCK_REALTIME.  This will allow us to skip the assertion with compromised CLOCK_MONOTONIC implementation which will not guarantee to never go back in time because it will use `gettimeofday()` but only when it's set.

Is this a good compromise for platforms which does not support monotonic clock?
Hopefully this will spark the discussion and agreement how to proceed in this situation.

Reviewed By: #libc, ldionne, hubert.reinterpretcast

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




More information about the All-commits mailing list