[libcxx-commits] [PATCH] D87940: [SystemZ][ZOS] Porting the time functions within libc++ to z/OS

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 18 13:52:23 PDT 2020


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

Assuming you already have them, I'd love to see the rest of the patches in the queue to know what we're getting into.

Also, if we're supporting a new platform, it needs to be tested. This means you need to add a bot testing libcxx on your system to the llvm builders.



================
Comment at: libcxx/include/__threading_support:539
    __libcpp_timespec_t __ts = __thread_detail::__convert_to_timespec(__ns);
+#if defined(__MVS__)
+   // The nanosleep() is not available on z/OS. Therefore,
----------------
Can z/OS implement `nanosleep()` like this, then? Sounds better to implement it once in your system library than in all the places it might be used.


================
Comment at: libcxx/src/filesystem/filesystem_common.h:411
+#if defined(__MVS__)
+  struct ::timeval ConvertedTS[2] = {
+      {TS[0].tv_sec, {}, Convert(TS[0].tv_nsec)},
----------------
So IIUC, `timeval` on z/OS is non-conforming to https://pubs.opengroup.org/onlinepubs/007908775/xsh/systime.h.html?

If we start having such differences, I think it would be better to introduce a `__libcpp_timeval` typedef and a `__libcpp_make_timeval(sec, nsec)` function. We have similar "abstraction" layers in the threading library.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87940/new/

https://reviews.llvm.org/D87940



More information about the libcxx-commits mailing list