[libc-commits] [PATCH] D137881: [libc] Implement gettimeofday

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Nov 14 12:12:28 PST 2022


sivachandra added inline comments.


================
Comment at: libc/spec/posix.td:1083-1087
           FunctionSpec<
-              "nanosleep",
+              "clock_gettime",
               RetValSpec<IntType>,
-              [
-	      	      ArgSpec<StructTimeSpecPtr>,
-	      	      ArgSpec<StructTimeSpecPtr>,
-	            ]
+              [ArgSpec<ClockIdT>, ArgSpec<StructTimeSpecPtr>]
           >,
----------------
michaelrj wrote:
> why did you move this?
They were likely rearranged to be in alphabetical order.


================
Comment at: libc/test/src/time/gettimeofday_test.cpp:32
+  // Call gettimeofday again and verify that it is more 100 microscecods and
+  // less than 300 microseconds,
+  struct timeval tv1;
----------------
The less than check is always going to be flaky. Instead, verify that the next value is greater than or equal to 200 microseconds from the old value. Repeat with a 1000 microsecond delay to reinforce.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137881



More information about the libc-commits mailing list