From 72aa1fdeceef03818eb7b197915d42ca76873919 Mon Sep 17 00:00:00 2001 From: vangyzen Date: Tue, 14 Mar 2017 17:52:43 +0000 Subject: MFC r314179 r314206 r314424 Add sem_clockwait_np() This function allows the caller to specify the reference clock and choose between absolute and relative mode. In relative mode, the remaining time can be returned. The API is similar to clock_nanosleep(3). Thanks to Ed Schouten for that suggestion. While I'm here, reduce the sleep time in the semaphore "child" test to greatly reduce its runtime. Also add a reasonable timeout. Relnotes: yes Sponsored by: Dell EMC --- include/semaphore.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/semaphore.h b/include/semaphore.h index c42a8d2..110f7c8 100644 --- a/include/semaphore.h +++ b/include/semaphore.h @@ -52,6 +52,10 @@ typedef struct _sem sem_t; struct timespec; __BEGIN_DECLS +#if __BSD_VISIBLE +int sem_clockwait_np(sem_t * __restrict, __clockid_t, int, + const struct timespec *, struct timespec *); +#endif int sem_close(sem_t *); int sem_destroy(sem_t *); int sem_getvalue(sem_t * __restrict, int * __restrict); -- cgit v1.1