aboutsummaryrefslogtreecommitdiff
path: root/src/lib9
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-01-27 05:51:54 +0000
committerrsc <devnull@localhost>2006-01-27 05:51:54 +0000
commitc54b8b69ede9d92e802baa1163d9cd734b034fb4 (patch)
tree7b36e7792b73a8ed5c8f2373a346efa5b1735d5f /src/lib9
parentbc5d57712754818a2320a385afbf1c0c9558a4b3 (diff)
downloadplan9port-c54b8b69ede9d92e802baa1163d9cd734b034fb4.tar.gz
plan9port-c54b8b69ede9d92e802baa1163d9cd734b034fb4.tar.bz2
plan9port-c54b8b69ede9d92e802baa1163d9cd734b034fb4.zip
bsd
Diffstat (limited to 'src/lib9')
-rw-r--r--src/lib9/sleep.c10
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)
{