From c54b8b69ede9d92e802baa1163d9cd734b034fb4 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 27 Jan 2006 05:51:54 +0000 Subject: bsd --- src/lib9/sleep.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/lib9') diff --git a/src/lib9/sleep.c b/src/lib9/sleep.c index 5da602eb..7a5c79fd 100644 --- a/src/lib9/sleep.c +++ b/src/lib9/sleep.c @@ -1,9 +1,19 @@ #include #define NOPLAN9DEFINES +#include #include #include #include +#if defined(__NetBSD__) || (defined(__OpenBSD__) && OpenBSD <= 200511) +# define sched_yield() \ +# do{ struct timespec ts; \ +# ts.tv_sec = 0; \ +# ts.tv_nsec = 10; \ +# nanosleep(&ts, 0); \ +# }while(0) +#endif + int p9sleep(long milli) { -- cgit v1.2.3