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

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 25 09:24:55 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: libcxx/include/__threading_support:540-543
+   // The nanosleep() is not available on z/OS. Therefore,
+   // we will call sleep() to sleep for a whole seconds
+   // and usleep() to sleep for a fraction of a second.
+   // Any remaining nano seconds will round up to the next micro second.
----------------
Minor comment: Wording suggestion.


================
Comment at: libcxx/include/__threading_support:548-549
+   {
+   __ts.tv_sec++;
+   __micro_sec = 0;
+   }
----------------
If it was worthwhile to write the test as `> 999999`, then it is worthwhile to write the reduction in microseconds as `-= 1000000`.
Also, minor nit: Indentation.


================
Comment at: libcxx/include/__threading_support:554
+   if (__micro_sec)
+      usleep(__micro_sec);
+#else
----------------
Unfortunately, if a signal occurs, we have no convenient way of knowing how much time is left. We can still loop though.


================
Comment at: libcxx/src/filesystem/filesystem_common.h:407-413
+  TimeVal TV = {
+    ts.tv_sec,
+#if defined(__MVS__)
+    {},
+#endif
+    Convert(ts.tv_nsec)
+  };
----------------
Let's use a more generic change here instead of a change that regresses z/OS under 31-bit.


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