Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs...
authorRaman Tenneti <rtenneti@google.com>
Sat, 24 Sep 2022 00:13:23 +0000 (00:13 +0000)
committerJeff Bailey <jeffbailey@google.com>
Sat, 24 Sep 2022 00:13:58 +0000 (00:13 +0000)
commit8f1e362ee9275a687693448bd975194ee9b984f2
tree542c3838f1481757f7999a13d9cb11b9cbc7de3d
parent3bbb2c2d99b96a84306629d674ee00455f56b0fa
Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

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>
Reviewed By: sivachandra, jeffbailey

Differential Revision: https://reviews.llvm.org/D134095
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.h
libc/spec/posix.td
libc/src/time/CMakeLists.txt
libc/src/time/nanosleep.cpp [new file with mode: 0644]
libc/src/time/nanosleep.h [new file with mode: 0644]
libc/test/src/time/CMakeLists.txt
libc/test/src/time/nanosleep_test.cpp [new file with mode: 0644]