summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/gen/t_sleep.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/gen/t_sleep.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
index f722ec9..e85867a 100644
--- a/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
+++ b/contrib/netbsd-tests/lib/libc/gen/t_sleep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sleep.c,v 1.8 2014/07/15 14:56:34 gson Exp $ */
+/* $NetBSD: t_sleep.c,v 1.11 2017/01/10 15:43:59 maya Exp $ */
/*-
* Copyright (c) 2006 Frank Kardel
@@ -26,8 +26,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef __FreeBSD__
+/* kqueue(2) on FreeBSD requires sys/types.h for uintptr_t; NetBSD doesn't. */
+#include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+#include <sys/event.h>
+#include <sys/signal.h>
+#include <sys/time.h> /* for TIMESPEC_TO_TIMEVAL on FreeBSD */
+
#include <atf-c.h>
#include <errno.h>
+#include <inttypes.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,10 +45,6 @@
#include <time.h>
#include <unistd.h>
-#include <sys/cdefs.h>
-#include <sys/event.h>
-#include <sys/signal.h>
-
#include "isqemu.h"
#define BILLION 1000000000LL /* nano-seconds per second */
@@ -49,11 +55,6 @@
#define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */
#define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */
-#ifdef __FreeBSD__
-#include <sys/time.h>
-#include <inttypes.h>
-#endif
-
/*
* Timer notes
*
@@ -180,7 +181,8 @@ do_kevent(struct timespec *delay, struct timespec *remain)
(void)close(kq);
if (rtc == -1) {
- ATF_REQUIRE_MSG(kerrno == EINTR, "kevent: %s", strerror(errno));
+ ATF_REQUIRE_MSG(kerrno == EINTR, "kevent: %s",
+ strerror(kerrno));
return 0;
}
OpenPOWER on IntegriCloud