2 * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
12 #include <syscall_utils.h>
14 #include <errno_private.h>
19 sigtimedwait(const sigset_t
* set
, siginfo_t
* info
,
20 const struct timespec
* timeout
)
22 // make info non-NULL to simplify things
27 // translate the timeout
29 bigtime_t timeoutMicros
;
30 if (timeout
!= NULL
) {
31 timeoutMicros
= system_time();
32 flags
= B_ABSOLUTE_TIMEOUT
;
33 timeoutMicros
+= (bigtime_t
)timeout
->tv_sec
* 1000000
34 + timeout
->tv_nsec
/ 1000;
40 status_t error
= _kern_sigwait(set
, info
, flags
, timeoutMicros
);
45 RETURN_AND_SET_ERRNO(error
);
47 return info
->si_signo
;