path: root/include/time.h
diff options
authorEric van Gyzen <vangyzen@FreeBSD.org>2017-03-19 00:51:12 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2017-03-19 00:51:12 +0000
commit3f8455b0905a05552b1155e09165787e1d098060 (patch)
tree7e464dbfe7b8012fa2a68d9d0a7b2d3a07b11df3 /include/time.h
parenta776eeafdcaae027734542d69612d35971b55c1c (diff)
Add clock_nanosleep()
Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Reviewed by: kib, ngie, jilles MFC after: 3 weeks Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10020
Notes: svn path=/head/; revision=315526
Diffstat (limited to 'include/time.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/include/time.h b/include/time.h
index c1725385c646..54c7e490473c 100644
--- a/include/time.h
+++ b/include/time.h
@@ -169,12 +169,12 @@ void tzset(void);
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
-/* XXX missing: clock_nanosleep() */
int nanosleep(const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */
#if __POSIX_VISIBLE >= 200112
int clock_getcpuclockid(pid_t, clockid_t *);
+int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
#if __POSIX_VISIBLE >= 199506