[libc-commits] [PATCH] D134095: Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

Raman Tenneti via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Sep 23 16:39:20 PDT 2022


rtenneti updated this revision to Diff 462616.
rtenneti marked 4 inline comments as done.
rtenneti added a comment.

Fixed comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134095

Files:
  libc/include/llvm-libc-types/CMakeLists.txt
  libc/include/llvm-libc-types/struct_timespec.h
  libc/test/src/time/nanosleep_test.cpp


Index: libc/test/src/time/nanosleep_test.cpp
===================================================================
--- libc/test/src/time/nanosleep_test.cpp
+++ libc/test/src/time/nanosleep_test.cpp
@@ -15,9 +15,8 @@
 
 namespace cpp = __llvm_libc::cpp;
 
-// TODO: When we have the code to read clocks, test that time has passed.
-
-TEST(LlvmLibcNanosleep, sleep) {
+TEST(LlvmLibcNanosleep, SmokeTest) {
+  // TODO: When we have the code to read clocks, test that time has passed.
   using __llvm_libc::testing::ErrnoSetterMatcher::Succeeds;
   errno = 0;
 
Index: libc/include/llvm-libc-types/struct_timespec.h
===================================================================
--- libc/include/llvm-libc-types/struct_timespec.h
+++ libc/include/llvm-libc-types/struct_timespec.h
@@ -13,6 +13,7 @@
 
 struct timespec {
   time_t tv_sec;      /* Seconds.  */
+  /* TODO: BIG_ENDIAN may require padding. */
   long   tv_nsec;     /* Nanoseconds.  */
 };
 
Index: libc/include/llvm-libc-types/CMakeLists.txt
===================================================================
--- libc/include/llvm-libc-types/CMakeLists.txt
+++ libc/include/llvm-libc-types/CMakeLists.txt
@@ -38,10 +38,10 @@
 add_header(struct_sigaction HDR struct_sigaction.h)
 add_header(struct_tm HDR struct_tm.h)
 add_header(struct_utsname HDR struct_utsname.h)
-add_header(struct_timespec HDR struct_timespec.h)
 add_header(thrd_start_t HDR thrd_start_t.h)
 add_header(thrd_t HDR thrd_t.h DEPENDS .__thread_type)
 add_header(time_t HDR time_t.h)
+add_header(struct_timespec HDR struct_timespec.h DEPENDS .time_t)
 add_header(tss_t HDR tss_t.h)
 add_header(tss_dtor_t HDR tss_dtor_t.h)
 add_header(__atexithandler_t HDR __atexithandler_t.h)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134095.462616.patch
Type: text/x-patch
Size: 1710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220923/24e68ea8/attachment.bin>


More information about the libc-commits mailing list