Tested:
Limited unit test: This makes a call and checks that no error was
returned, but we currently don't have the ability to ensure that
time has elapsed as expected.
Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Paths
| Differential D134095
Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html ClosedPublic Authored by rtenneti on Sep 16 2022, 5:40 PM.
Details Summary Tested: Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 16 2022, 5:40 PM sivachandra added inline comments.
This revision is now accepted and ready to land.Sep 19 2022, 10:27 AM Closed by commit rG8f1e362ee927: Implement nanosleep per https://pubs.opengroup. (authored by rtenneti, committed by jeffbailey). · Explain WhySep 23 2022, 5:14 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 462627 libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/api.td
libc/config/linux/x86_64/entrypoints.txt
libc/include/CMakeLists.txt
libc/include/llvm-libc-types/struct_timespec.hlibc/spec/posix.td
libc/src/time/CMakeLists.txt
libc/src/time/nanosleep.h
libc/src/time/nanosleep.cpp
libc/test/src/time/CMakeLists.txt
libc/test/src/time/nanosleep_test.cpp
|
I think this definition is correct as per the POSIX spec. But, since we are passing structures of this shape to the Linux syscall, we should probably add a comment or TODO in src/time/nanosleep.cpp explaining why this definition is sufficient or incomplete.