diff options
Diffstat (limited to 'src/lib9')
-rw-r--r-- | src/lib9/sleep.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 <u.h> #define NOPLAN9DEFINES +#include <sys/param.h> #include <sys/time.h> #include <sched.h> #include <libc.h> +#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) { |