[libcxx-commits] [PATCH] D99373: [SystemZ][z/OS] correct rc and errno within nanosleep()

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 1 09:28:52 PDT 2021


Mordante added inline comments.


================
Comment at: libcxx/include/__support/ibm/nanosleep.h:35
+      __rem->tv_sec = __sec;
+      // nanoseconds can be a large number, 999999999 at the max
+      __rem->tv_nsec = __micro_sec * 1000;
----------------
Please use complete sentences starting with a capital and ending with a full stop.


================
Comment at: libcxx/include/__support/ibm/nanosleep.h:45
+      __rem->tv_sec = 0;
+      // nanoseconds can be a large number, 999999999 at the max
+      __rem->tv_nsec = __micro_sec * 1000;
----------------
I think I wasn't clear enough regarding what I meant with too large.
When `nanosleep` fails with `EINTR` it should set the remaining time in `__rem`. 
When it fails during `sleep` it sets the proper value (except rounding up).
When it fails during `usleep` with `EINTR` it acts as if it slept for 0 µs, which might be wrong. AFAIK it's not possible to fix this unless `usleep` on z/OS provides more information.

So I like the mentioning of the rounding up, but I would also like some information regarding ignoring the time slept.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99373



More information about the libcxx-commits mailing list